diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-03-24 10:29:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 10:29:10 +0200 |
commit | 4b13dba4458e5272de896a07b5844123c89d5223 (patch) | |
tree | 927bcb4745869d6e61cc44a2013e89e76696f97e /database | |
parent | fe93dcce9fe94d6d0a7bb182207a5a6a26c764bb (diff) |
Dont send a snapshot with snapshot id 0 (#12469)
Diffstat (limited to 'database')
-rw-r--r-- | database/sqlite/sqlite_aclk_alert.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/database/sqlite/sqlite_aclk_alert.c b/database/sqlite/sqlite_aclk_alert.c index 3dfe9b356d..0e1e849f4b 100644 --- a/database/sqlite/sqlite_aclk_alert.c +++ b/database/sqlite/sqlite_aclk_alert.c @@ -661,6 +661,8 @@ void aclk_process_send_alarm_snapshot(char *node_id, char *claim_id, uint64_t sn wc->host ? wc->host->hostname : "N/A", snapshot_id, sequence_id); + if (wc->alerts_snapshot_id == snapshot_id) + return; __sync_synchronize(); wc->alerts_snapshot_id = snapshot_id; wc->alerts_ack_sequence_id = sequence_id; @@ -783,6 +785,9 @@ void aclk_push_alert_snapshot_event(struct aclk_database_worker_config *wc, stru return; } + if (unlikely(!wc->alerts_snapshot_id)) + return; + char *claim_id = is_agent_claimed(); if (unlikely(!claim_id)) return; |