comeuplater / fastapi_cache

FastAPI simple cache
MIT License
218 stars 19 forks source link

The sample code provided does not work #9

Open santosh-gokul opened 3 years ago

santosh-gokul commented 3 years ago

Hey,

The cache.set() doesn't work, due to the reason it it has no support for three parameters. The sample code provided however does that. If that is ttl, may be we may want to use .expire(), please look into it.

demian-sl commented 3 years ago

Same here: cache.set("TST_KEY", "TST_VAL", 5) TypeError: set() takes 3 positional arguments but 4 were given

gshivammsg commented 1 year ago

i used this ===> await cache.set(access_token, data) await cache.expire(access_token,30) here 30 is time in seconds . This works fine for me.