Skip to content
Snippets Groups Projects
Commit 14a226be authored by famelis's avatar famelis
Browse files

fix: check if alarm list is empty before return

parent 8065cee7
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!82Monitoring: fixes regarding the kpi value ranges
......@@ -324,8 +324,11 @@ class MetricsDB():
alarm = True
if alarm:
valid_kpi_list.append(kpi)
alarm_queue.put_nowait(valid_kpi_list)
LOGGER.debug(f"Alarm of KPI {kpi_id} triggered -> kpi_value:{kpi[2]}, timestamp:{kpi[1]}")
if valid_kpi_list:
alarm_queue.put_nowait(valid_kpi_list)
LOGGER.debug(f"Alarm of KPI {kpi_id} triggered -> kpi_value:{kpi[2]}, timestamp:{kpi[1]}")
else:
LOGGER.debug(f"No new alarms triggered for the alarm of KPI {kpi_id}")
else:
LOGGER.debug(f"No new data for the alarm of KPI {kpi_id}")
except (Exception) as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment