This commit is contained in:
lz_db
2026-10-17 09:41:11 +08:00
parent c519bdae9f
commit 28b11b4365
7 changed files with 126 additions and 28 deletions
Binary file not shown.
+2 -1
View File
@@ -3,7 +3,8 @@ import redis.asyncio as aioredis
from app.config import settings
redis_client: aioredis.Redis = aioredis.from_url(settings.redis_url, decode_responses=True)
# protocol=2:服务器为 Redis 5.x,不支持 RESP3 的 HELLO 握手(redis-py 8.x 默认尝试 3)
redis_client: aioredis.Redis = aioredis.from_url(settings.redis_url, decode_responses=True, protocol=2)
async def get_redis() -> aioredis.Redis: