fix(edge): 云端Redis默认db改为1,配置更新回调支持所有同步模式

- CloudRedisConfig.db 默认值从0改为1,与部署环境一致
- 配置更新回调不再限制为LOCAL模式,REDIS模式也支持动态热更新

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 15:48:18 +08:00
parent 6d1e0e4a5e
commit a49a1be0eb
2 changed files with 3 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ class CloudRedisConfig:
"""云端 Redis 配置(三层权威模型 - 云端层)""" """云端 Redis 配置(三层权威模型 - 云端层)"""
host: str = "localhost" host: str = "localhost"
port: int = 6379 port: int = 6379
db: int = 0 db: int = 1
password: Optional[str] = None password: Optional[str] = None
decode_responses: bool = True decode_responses: bool = True
max_connections: int = 20 max_connections: int = 20
@@ -227,7 +227,7 @@ class Settings:
self.cloud_redis = CloudRedisConfig( self.cloud_redis = CloudRedisConfig(
host=os.getenv("CLOUD_REDIS_HOST", "localhost"), host=os.getenv("CLOUD_REDIS_HOST", "localhost"),
port=int(os.getenv("CLOUD_REDIS_PORT", "6379")), 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"), password=os.getenv("CLOUD_REDIS_PASSWORD"),
) )

View File

@@ -96,7 +96,7 @@ class EdgeInferenceService:
try: try:
self._config_manager = get_config_sync_manager() self._config_manager = get_config_sync_manager()
self._config_manager.start_config_subscription() 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): def _on_config_update(topic, data):
if self._algorithm_manager: if self._algorithm_manager:
# 保留状态地更新参数,避免告警重复 # 保留状态地更新参数,避免告警重复