From a49a1be0eb7b3529a9bd976a47dc6068b416f9d7 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Sat, 28 Feb 2026 15:48:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(edge):=20=E4=BA=91=E7=AB=AFRedis=E9=BB=98?= =?UTF-8?q?=E8=AE=A4db=E6=94=B9=E4=B8=BA1=EF=BC=8C=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9B=9E=E8=B0=83=E6=94=AF=E6=8C=81=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=90=8C=E6=AD=A5=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CloudRedisConfig.db 默认值从0改为1,与部署环境一致 - 配置更新回调不再限制为LOCAL模式,REDIS模式也支持动态热更新 Co-Authored-By: Claude Opus 4.6 --- config/settings.py | 4 ++-- main.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/settings.py b/config/settings.py index 9aab261..7e6746d 100644 --- a/config/settings.py +++ b/config/settings.py @@ -48,7 +48,7 @@ class CloudRedisConfig: """云端 Redis 配置(三层权威模型 - 云端层)""" host: str = "localhost" port: int = 6379 - db: int = 0 + db: int = 1 password: Optional[str] = None decode_responses: bool = True max_connections: int = 20 @@ -227,7 +227,7 @@ class Settings: self.cloud_redis = CloudRedisConfig( host=os.getenv("CLOUD_REDIS_HOST", "localhost"), port=int(os.getenv("CLOUD_REDIS_PORT", "6379")), - db=int(os.getenv("CLOUD_REDIS_DB", "0")), + db=int(os.getenv("CLOUD_REDIS_DB", "1")), password=os.getenv("CLOUD_REDIS_PASSWORD"), ) diff --git a/main.py b/main.py index fea1fd7..ff8edaa 100644 --- a/main.py +++ b/main.py @@ -96,7 +96,7 @@ class EdgeInferenceService: try: self._config_manager = get_config_sync_manager() self._config_manager.start_config_subscription() - if self._settings.config_sync_mode == "LOCAL" and self._config_manager: + if self._config_manager: def _on_config_update(topic, data): if self._algorithm_manager: # 保留状态地更新参数,避免告警重复