fix: 修复get_bindings_from_redis空roi_id过滤bug

当roi_id为空字符串时(reload_all_algorithms调用),原逻辑
data.get('roi_id') == "" 匹配不到任何bind,导致全量重载
始终返回0个算法。改为 not roi_id or 匹配,空值时返回全部。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-05 09:57:20 +08:00
parent 9b4b69a65c
commit bef62e430c

View File

@@ -589,7 +589,7 @@ class ConfigSyncManager:
results = []
for key in keys:
data = self._redis_client.hgetall(key)
if data and data.get('roi_id') == roi_id:
if data and (not roi_id or data.get('roi_id') == roi_id):
data['params'] = eval(data['params']) if data.get('params') else {}
data['priority'] = int(data.get('priority', 0))
data['enabled'] = data.get('enabled', 'True') == 'True'