File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,5 @@ tenacity==9.0.0
2222urllib3 == 2.3.0
2323lxml == 5.3.0
2424google-genai
25+ redis >= 4.2.0
26+
Original file line number Diff line number Diff line change 1- aioredis == 2.0.1
1+ redis >= 4. 2.0
22fastapi == 0.115.11
33issn == 0.0.3
44pydantic == 2.10.6
Original file line number Diff line number Diff line change 2020"""
2121
2222from typing import Optional
23- import aioredis
23+ from redis import asyncio as aioredis
2424from src .utils .logging_config import get_logger
2525
2626logger = get_logger (__name__ )
2727
2828# Redis connection settings
29- REDIS_URL = "redis://localhost:6379"
29+ # REDIS_URL = "redis://localhost:6379"
3030redis_client : Optional [aioredis .Redis ] = None
3131
3232async def init_redis ():
3333 """Initialize Redis connection"""
3434 global redis_client
3535 try :
36- redis_client = await aioredis .from_url (
37- REDIS_URL ,
38- encoding = "utf-8" ,
39- decode_responses = True
40- )
36+ redis_client = aioredis .Redis (
37+ host = 'localhost' ,
38+ port = 6379 ,
39+ db = 0 ,
40+ decode_responses = True
41+ )
42+
43+
4144 except Exception as e :
4245 logger .error (f"Failed to initialize Redis connection: { str (e )} " )
4346 raise
You can’t perform that action at this time.
0 commit comments