修复:云端 Redis 连接加 keepalive + 健康检查,防止频繁断连

腾讯云 Redis 空闲连接超时会主动断开,加 socket_keepalive=True
和 health_check_interval=30 保活,减少重连频率。
This commit is contained in:
2026-03-20 10:03:41 +08:00
parent 369bb02391
commit d5c443c7c6
2 changed files with 4 additions and 0 deletions

View File

@@ -206,6 +206,8 @@ class ConfigSyncManager:
socket_connect_timeout=10,
socket_timeout=10,
retry_on_timeout=True,
socket_keepalive=True,
health_check_interval=30,
)
self._cloud_redis.ping()
logger.info(f"云端 Redis 连接成功: {cfg.host}:{cfg.port}/{cfg.db}")

View File

@@ -200,6 +200,8 @@ class EdgeInferenceService:
socket_connect_timeout=5,
socket_timeout=10,
retry_on_timeout=True,
socket_keepalive=True,
health_check_interval=30,
)
cloud_redis.ping()
self._logger.info(f"截图处理器独立连接云端 Redis 成功: {cfg.host}:{cfg.port}/{cfg.db}")