Revert "fix(config-sync): 修复全量同步时空配置不清理旧数据的bug"
This reverts commit 66c8039889.
This commit is contained in:
@@ -886,17 +886,15 @@ class ConfigSyncManager:
|
||||
sync_mode = config_data.get("sync_mode", "partial")
|
||||
if sync_mode == "full":
|
||||
self._init_database()
|
||||
if self._db_manager:
|
||||
if self._db_manager and incoming_ids:
|
||||
try:
|
||||
existing = self._db_manager.get_all_camera_configs()
|
||||
for cam in existing:
|
||||
old_id = cam.get("camera_id")
|
||||
# 如果incoming_ids为空,清除所有旧配置
|
||||
# 如果incoming_ids不为空,清除不在列表中的旧配置
|
||||
if old_id and old_id not in incoming_ids:
|
||||
self._clear_rois_for_camera_ids([old_id])
|
||||
self._db_manager.delete_camera_config(old_id)
|
||||
logger.info(f"[EDGE] 全量同步清除旧摄像头: {old_id}")
|
||||
logger.info(f"[EDGE] 清除不在推送列表中的旧摄像头: {old_id}")
|
||||
except Exception as e:
|
||||
logger.warning(f"[EDGE] 清理旧摄像头失败: {e}")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user