summaryrefslogtreecommitdiffstats
path: root/src/fuzzy_storage.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-27 12:47:30 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-27 12:47:30 +0100
commit948d6c90b1160dea389aca1662fad5c325e5d552 (patch)
treeda79f6b9b51db159c1c689be0c10c7427416b727 /src/fuzzy_storage.c
parent91515f2995f87befae5816840a0684ffc7297980 (diff)
downloadrspamd-948d6c90b1160dea389aca1662fad5c325e5d552.tar.gz
rspamd-948d6c90b1160dea389aca1662fad5c325e5d552.zip
[Fix] Send updates to mirrors only if we have some changes
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r--src/fuzzy_storage.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 04292e363..c182971a5 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -423,13 +423,15 @@ rspamd_fuzzy_process_updates_queue (struct rspamd_fuzzy_storage_ctx *ctx,
cur = g_list_next (cur);
}
- if (rspamd_fuzzy_backend_finish_update (ctx->backend, source)) {
+ if (rspamd_fuzzy_backend_finish_update (ctx->backend, source, nupdates > 0)) {
ctx->stat.fuzzy_hashes = rspamd_fuzzy_backend_count (ctx->backend);
- for (i = 0; i < ctx->mirrors->len; i ++) {
- m = g_ptr_array_index (ctx->mirrors, i);
+ if (nupdates > 0) {
+ for (i = 0; i < ctx->mirrors->len; i ++) {
+ m = g_ptr_array_index (ctx->mirrors, i);
- rspamd_fuzzy_send_update_mirror (ctx, m);
+ rspamd_fuzzy_send_update_mirror (ctx, m);
+ }
}
/* Clear updates */