mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-25 04:57:54 +00:00
Update README.md
Updated readme to reflect the changes in aioredis 2.0
This commit is contained in:
@@ -69,7 +69,7 @@ async def index(request: Request, response: Response):
|
|||||||
|
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
async def startup():
|
async def startup():
|
||||||
redis = await aioredis.create_redis_pool("redis://localhost", encoding="utf8")
|
redis = aioredis.from_url("redis://localhost", encoding="utf8", decode_responses=True)
|
||||||
FastAPICache.init(RedisBackend(redis), prefix="fastapi-cache")
|
FastAPICache.init(RedisBackend(redis), prefix="fastapi-cache")
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user