mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-03-06 14:03:07 +00:00
fix: redis cache uses sync client due to import shadowing
import redis.exceptions overwrites the redis name binding from import redis.asyncio as redis, causing from_url() to create a sync client. ping() then returns bool instead of coroutine. Fix: from redis.exceptions import NoScriptError
This commit is contained in:
@@ -4,8 +4,8 @@ from datetime import timedelta
|
||||
from typing import Any
|
||||
|
||||
import redis.asyncio as redis
|
||||
import redis.exceptions
|
||||
import structlog
|
||||
from redis.exceptions import NoScriptError
|
||||
|
||||
from app.config import settings
|
||||
|
||||
@@ -383,7 +383,7 @@ return c
|
||||
key,
|
||||
window,
|
||||
)
|
||||
except redis.exceptions.NoScriptError:
|
||||
except NoScriptError:
|
||||
# SHA evicted from Redis script cache — reload and retry
|
||||
RateLimitCache._rate_limit_sha = await cache.redis_client.script_load(
|
||||
RateLimitCache._RATE_LIMIT_SCRIPT,
|
||||
|
||||
Reference in New Issue
Block a user