mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-25 04:57:54 +00:00
This fixes #24. Looking at aioredis library, the client.py keyword for set is now 'ex', not 'expire'. Tested this fix and fast-cache now works without issue.
This commit is contained in:
@@ -19,7 +19,7 @@ class RedisBackend(Backend):
|
|||||||
return await self.redis.get(key)
|
return await self.redis.get(key)
|
||||||
|
|
||||||
async def set(self, key: str, value: str, expire: int = None):
|
async def set(self, key: str, value: str, expire: int = None):
|
||||||
return await self.redis.set(key, value, expire=expire)
|
return await self.redis.set(key, value, ex=expire)
|
||||||
|
|
||||||
async def clear(self, namespace: str = None, key: str = None) -> int:
|
async def clear(self, namespace: str = None, key: str = None) -> int:
|
||||||
if namespace:
|
if namespace:
|
||||||
|
|||||||
Reference in New Issue
Block a user