From: Vsevolod Stakhov Date: Mon, 28 Sep 2015 17:41:22 +0000 (+0100) Subject: Preserve expired fuzzy hashes counter. X-Git-Tag: 1.0.4~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=352e35b245ba850cbb39f0fc07777e727f99484a;p=rspamd.git Preserve expired fuzzy hashes counter. --- diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index 016f0c6e0..159570c1e 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -265,12 +265,17 @@ sync_callback (gint fd, short what, void *arg) struct rspamd_worker *worker = (struct rspamd_worker *)arg; struct rspamd_fuzzy_storage_ctx *ctx; gdouble next_check; + guint64 old_expired, new_expired; ctx = worker->ctx; /* Call backend sync */ + old_expired = rspamd_fuzzy_backend_expired (ctx->backend); rspamd_fuzzy_backend_sync (ctx->backend, ctx->expire, TRUE); + new_expired = rspamd_fuzzy_backend_expired (ctx->backend); - server_stat->fuzzy_hashes_expired = rspamd_fuzzy_backend_expired (ctx->backend); + if (old_expired < new_expired) { + server_stat->fuzzy_hashes_expired += new_expired - old_expired; + } /* Timer event */ event_del (&tev);