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: