diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2023-08-02 19:08:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-02 19:08:17 +0300 |
commit | ea911637b9045f7e6ea119ab0e02ceaf8ea0ff26 (patch) | |
tree | a8a1c8ca1d4209176be0cfc15bec4f8998981ac0 /database | |
parent | 0a5050f28bd0fe90a4074808bf6e2e8538d28e9e (diff) |
Better cleanup of aclk alert table entries (#15706)
better cleanup of aclk alert table entries
Diffstat (limited to 'database')
-rw-r--r-- | database/sqlite/sqlite_aclk_alert.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/database/sqlite/sqlite_aclk_alert.c b/database/sqlite/sqlite_aclk_alert.c index 7cedaebf2b..0ad3ff2fc2 100644 --- a/database/sqlite/sqlite_aclk_alert.c +++ b/database/sqlite/sqlite_aclk_alert.c @@ -7,7 +7,7 @@ #include "../../aclk/aclk_alarm_api.h" #endif -#define SQL_UPDATE_FILTERED_ALERT "UPDATE aclk_alert_%s SET filtered_alert_unique_id = %u where filtered_alert_unique_id = %u" +#define SQL_UPDATE_FILTERED_ALERT "UPDATE aclk_alert_%s SET filtered_alert_unique_id = %u, date_created = unixepoch() where filtered_alert_unique_id = %u" void update_filtered(ALARM_ENTRY *ae, uint32_t unique_id, char *uuid_str) { char sql[ACLK_SYNC_QUERY_SIZE]; snprintfz(sql, ACLK_SYNC_QUERY_SIZE-1, SQL_UPDATE_FILTERED_ALERT, uuid_str, ae->unique_id, unique_id); @@ -979,7 +979,7 @@ void aclk_push_alert_snapshot_event(char *node_id __maybe_unused) #endif } -#define SQL_DELETE_ALERT_ENTRIES "DELETE FROM aclk_alert_%s WHERE filtered_alert_unique_id + %d < UNIXEPOCH();" +#define SQL_DELETE_ALERT_ENTRIES "DELETE FROM aclk_alert_%s WHERE date_created + %d < UNIXEPOCH();" void sql_aclk_alert_clean_dead_entries(RRDHOST *host) { char uuid_str[UUID_STR_LEN]; |