Update README.md

Updated readme to reflect the changes in aioredis 2.0
This commit is contained in:
heliumbrain
2021-07-15 23:15:01 +02:00
parent 7c7aa26a88
commit 9e3c9816c5

View File

@@ -69,7 +69,7 @@ async def index(request: Request, response: Response):
@app.on_event("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")
```