From c90a770e01bcde639edbbd43e41c31624ab70b2c Mon Sep 17 00:00:00 2001 From: Pankaj Kumar Singh Date: Wed, 21 Jun 2023 13:11:16 +0200 Subject: [PATCH] chore: update redis dependency and refactor Redis imports - Update redis dependency from aioredis==2.0.1 to redis==4.5.5 - Refactor Redis imports to use the asyncio module from redis package instead of aioredis module --- requirements/base.txt | 2 +- src/main.py | 2 +- src/redis.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 1b1985e..d28163c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,4 +1,4 @@ -aioredis==2.0.1 +redis==4.5.5 alembic==1.9.1 bcrypt databases[asyncpg]==0.7.0 diff --git a/src/main.py b/src/main.py index fda4a36..2c713a3 100644 --- a/src/main.py +++ b/src/main.py @@ -1,11 +1,11 @@ from contextlib import asynccontextmanager from typing import AsyncGenerator -import aioredis import sentry_sdk from fastapi import FastAPI from starlette.middleware.cors import CORSMiddleware +from redis import asyncio as aioredis from src import redis from src.auth.router import router as auth_router from src.config import app_configs, settings diff --git a/src/redis.py b/src/redis.py index 660e9cb..85a14a3 100644 --- a/src/redis.py +++ b/src/redis.py @@ -1,8 +1,7 @@ from datetime import timedelta from typing import Optional -from aioredis import Redis - +from redis.asyncio import Redis from src.models import ORJSONModel redis_client: Redis = None # type: ignore