]> source.dussan.org Git - rspamd.git/commitdiff
Preserve expired fuzzy hashes counter.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 28 Sep 2015 17:41:22 +0000 (18:41 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 28 Sep 2015 17:41:22 +0000 (18:41 +0100)
src/fuzzy_storage.c

index 016f0c6e04b780cf64f7f148f847bbdc00c7e956..159570c1e43d24e8607c04537c8f1d48ecdc25eb 100644 (file)
@@ -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);