fix: 告警阈值脚本去掉错误的config嵌套
This commit is contained in:
parent
941f0678a1
commit
523e4ba1fe
@ -13,23 +13,15 @@ nodes = body['template']['nodes']
|
||||
for n in nodes:
|
||||
if n.get('id') != 'alarm_violation':
|
||||
continue
|
||||
cfg = n['config']
|
||||
cfg['cooldown_ms'] = 60000
|
||||
cfg['min_score'] = 0.5
|
||||
cfg['min_duration_ms'] = 1500
|
||||
cfg['min_hits'] = 3
|
||||
cfg['hit_window_ms'] = 3000
|
||||
|
||||
# 劳保鞋
|
||||
for r in cfg.get('rules', []):
|
||||
for r in n.get('rules', []):
|
||||
if r['name'] == 'non_compliant_workshoe':
|
||||
r['min_score'] = 0.5
|
||||
r['cooldown_ms'] = 60000
|
||||
r['min_hits'] = 3
|
||||
r['min_duration_ms'] = 1500
|
||||
|
||||
# 陌生人脸
|
||||
for r in cfg.get('face_rules', []):
|
||||
for r in n.get('face_rules', []):
|
||||
if r['name'] == 'unknown_face':
|
||||
r['cooldown_ms'] = 30000
|
||||
r['max_known_sim'] = 0.2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user