]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Call clickhouse periodic merely for scanners
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Nov 2019 14:18:23 +0000 (14:18 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Nov 2019 14:18:47 +0000 (14:18 +0000)
src/plugins/lua/clickhouse.lua

index 966543e3e31b3d676c28ede0173023c074a79595..442aee4c18fad1543e91257e946a890754d3892c 100644 (file)
@@ -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()