fix: AlgorithmManager处理type=full配置更新时全量重载
之前_config_update_worker只处理type=roi和type=bind, 收到type=full或type=camera时静默忽略,导致全量推送不生效。 现在对未识别的type统一执行reload_all_algorithms()。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -451,20 +451,24 @@ class AlgorithmManager:
|
||||
try:
|
||||
import json
|
||||
data = json.loads(message["data"])
|
||||
if data.get("type") == "roi":
|
||||
update_type = data.get("type", "full")
|
||||
if update_type == "roi":
|
||||
roi_ids = data.get("ids", [])
|
||||
if roi_ids:
|
||||
for roi_id in roi_ids:
|
||||
self.reload_algorithm(roi_id)
|
||||
else:
|
||||
self.reload_all_algorithms()
|
||||
elif data.get("type") == "bind":
|
||||
elif update_type == "bind":
|
||||
bind_ids = data.get("ids", [])
|
||||
if bind_ids:
|
||||
for bind_id in bind_ids:
|
||||
self.reload_bind_algorithm(bind_id)
|
||||
else:
|
||||
self.reload_all_algorithms()
|
||||
else:
|
||||
# type="full" / "camera" / unknown → 全量重载
|
||||
self.reload_all_algorithms()
|
||||
except Exception as e:
|
||||
logger.error(f"处理配置更新消息失败: {e}")
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user