Redis maint notif was disabled. ONLY FOR REDIS CLOUD
This commit is contained in:
parent
ec2bcc9402
commit
dc653737e0
1 changed files with 11 additions and 1 deletions
|
|
@ -13,7 +13,17 @@ def get_redis_client(redis_url: str) -> Any:
|
||||||
|
|
||||||
Callers own the connection lifecycle. The api creates one client at startup
|
Callers own the connection lifecycle. The api creates one client at startup
|
||||||
and stores it in app.state.redis.
|
and stores it in app.state.redis.
|
||||||
|
|
||||||
|
Maintenance notifications are disabled: they are a Redis Cloud feature and
|
||||||
|
self-hosted/Valkey servers reject ``CLIENT MAINT_NOTIFICATIONS`` with an
|
||||||
|
``unknown subcommand`` error, spamming debug logs.
|
||||||
"""
|
"""
|
||||||
from redis.asyncio import Redis as AsyncRedis
|
from redis.asyncio import Redis as AsyncRedis
|
||||||
|
from redis.maint_notifications import MaintNotificationsConfig
|
||||||
|
|
||||||
return AsyncRedis.from_url(redis_url, decode_responses=True)
|
maint_config = MaintNotificationsConfig(enabled=False)
|
||||||
|
return AsyncRedis.from_url(
|
||||||
|
redis_url,
|
||||||
|
decode_responses=True,
|
||||||
|
maint_notifications_config=maint_config,
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue