aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-07 21:28:57 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-07 21:28:57 +0000
commit409c8e10d5916de929915e127e20c112d5495620 (patch)
tree8a15a8cd8785832da5d3cc29950435d906ca14ec
parente38a930328b7e466828df6c8b73ac64805b24537 (diff)
downloadrspamd-409c8e10d5916de929915e127e20c112d5495620.tar.gz
rspamd-409c8e10d5916de929915e127e20c112d5495620.zip
Sync only one fuzzy worker, not all
-rw-r--r--src/fuzzy_storage.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index dd23c6112..8c870b090 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -636,14 +636,16 @@ start_fuzzy (struct rspamd_worker *worker)
ctx->keypair_cache = rspamd_keypair_cache_new (ctx->keypair_cache_size);
}
- rspamd_fuzzy_backend_sync (ctx->backend, ctx->expire, TRUE);
- /* Timer event */
- evtimer_set (&tev, sync_callback, worker);
- event_base_set (ctx->ev_base, &tev);
- /* Plan event with jitter */
- next_check = rspamd_time_jitter (ctx->sync_timeout, 0);
- double_to_tv (next_check, &tmv);
- evtimer_add (&tev, &tmv);
+ if (worker->index == 0) {
+ rspamd_fuzzy_backend_sync (ctx->backend, ctx->expire, TRUE);
+ /* Timer event */
+ evtimer_set (&tev, sync_callback, worker);
+ event_base_set (ctx->ev_base, &tev);
+ /* Plan event with jitter */
+ next_check = rspamd_time_jitter (ctx->sync_timeout, 0);
+ double_to_tv (next_check, &tmv);
+ evtimer_add (&tev, &tmv);
+ }
/* Register custom reload command for the control socket */
rspamd_control_worker_add_cmd_handler (worker, RSPAMD_CONTROL_RELOAD,