diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-06 14:18:23 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-06 14:18:47 +0000 |
commit | 1ca69a5c735892c97864d92dce2334e68ca22a98 (patch) | |
tree | 4175163b23be17062bc6a9db68cee1d5b0f1245e | |
parent | bd2ed02166626c1deccb8a0c23219a5da2546d03 (diff) | |
download | rspamd-1ca69a5c735892c97864d92dce2334e68ca22a98.tar.gz rspamd-1ca69a5c735892c97864d92dce2334e68ca22a98.zip |
[Minor] Call clickhouse periodic merely for scanners
-rw-r--r-- | src/plugins/lua/clickhouse.lua | 6 |
1 files 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() |