Skip to content

Commit

Permalink
This fixes #24. Looking at aioredis library, the client.py keyword fo…
Browse files Browse the repository at this point in the history
…r set is now 'ex', not 'expire'. Tested this fix and fast-cache now works without issue.
  • Loading branch information
dveleztx committed Jul 22, 2021
1 parent 0bc8c6c commit 2dd37b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastapi_cache/backends/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def get(self, key) -> str:
return await self.redis.get(key)

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:
if namespace:
Expand Down

0 comments on commit 2dd37b0

Please sign in to comment.