From e4605e8702851e59f194e10dae55d33da743f284 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Thu, 5 Feb 2026 09:59:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20AlgorithmManager=E5=A4=84=E7=90=86type?= =?UTF-8?q?=3Dfull=E9=85=8D=E7=BD=AE=E6=9B=B4=E6=96=B0=E6=97=B6=E5=85=A8?= =?UTF-8?q?=E9=87=8F=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前_config_update_worker只处理type=roi和type=bind, 收到type=full或type=camera时静默忽略,导致全量推送不生效。 现在对未识别的type统一执行reload_all_algorithms()。 Co-Authored-By: Claude Opus 4.5 --- algorithms.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/algorithms.py b/algorithms.py index b8b988a..5f5b68b 100644 --- a/algorithms.py +++ b/algorithms.py @@ -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: