diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-27 12:47:30 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-27 12:47:30 +0100 |
commit | 948d6c90b1160dea389aca1662fad5c325e5d552 (patch) | |
tree | da79f6b9b51db159c1c689be0c10c7427416b727 /src/fuzzy_storage.c | |
parent | 91515f2995f87befae5816840a0684ffc7297980 (diff) | |
download | rspamd-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.c | 10 |
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 */ |