fastapi_cache icon indicating copy to clipboard operation
fastapi_cache copied to clipboard

The sample code provided does not work

Open santosh-gokul opened this issue 4 years ago • 3 comments

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.

santosh-gokul avatar Mar 22 '21 07:03 santosh-gokul

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

demian-sl avatar May 21 '21 14:05 demian-sl

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.

gshivammsg avatar Jul 10 '23 09:07 gshivammsg