From 1ca69a5c735892c97864d92dce2334e68ca22a98 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 6 Nov 2019 14:18:23 +0000 Subject: [Minor] Call clickhouse periodic merely for scanners --- src/plugins/lua/clickhouse.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index 966543e3e..442aee4c1 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -1279,8 +1279,10 @@ if opts then end) -- Create tables on load rspamd_config:add_on_load(function(cfg, ev_base, worker) - rspamd_config:add_periodic(ev_base, 0, - clickhouse_maybe_send_data_periodic, true) + if worker:is_scanner() then + rspamd_config:add_periodic(ev_base, 0, + clickhouse_maybe_send_data_periodic, true) + end if worker:is_primary_controller() then local upstreams = settings.upstream:all_upstreams() -- cgit v1.2.3