diff --git a/core/config_sync.py b/core/config_sync.py index 1ae53e6..233c037 100644 --- a/core/config_sync.py +++ b/core/config_sync.py @@ -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}") diff --git a/main.py b/main.py index 975813d..ea63cb5 100644 --- a/main.py +++ b/main.py @@ -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}")