Skip to content

Commit

Permalink
Check alert duration on submission to the cloud (netdata#17144)
Browse files Browse the repository at this point in the history
Check alert duration on submission
  • Loading branch information
stelfrag authored Mar 11, 2024
1 parent e1411d2 commit 83dbe62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/database/sqlite/sqlite_aclk_alert.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ static void aclk_push_alert_event(struct aclk_sync_cfg_t *wc __maybe_unused)
strdupz("UNKNOWN=0=UNKNOWN");
alarm_log.command = strdupz(edit_command);

alarm_log.duration = (time_t) sqlite3_column_int64(res, 6);
time_t duration = (time_t) sqlite3_column_int64(res, 6);
alarm_log.duration = (duration > 0) ? duration : 0;
alarm_log.non_clear_duration = (time_t) sqlite3_column_int64(res, 7);
alarm_log.status = rrdcalc_status_to_proto_enum((RRDCALC_STATUS) sqlite3_column_int(res, 19));
alarm_log.old_status = rrdcalc_status_to_proto_enum((RRDCALC_STATUS) sqlite3_column_int(res, 20));
Expand Down

0 comments on commit 83dbe62

Please sign in to comment.