From: Andrew Lewis Date: Sat, 26 Aug 2017 09:57:23 +0000 (+0200) Subject: [Minor] Use controller for single-instance tasks X-Git-Tag: 1.6.4~22^2~27 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7b11a99e43792dea244a43061e6303631e5238be;p=rspamd.git [Minor] Use controller for single-instance tasks --- diff --git a/src/plugins/lua/bayes_expiry.lua b/src/plugins/lua/bayes_expiry.lua index d7df264a1..674727e42 100644 --- a/src/plugins/lua/bayes_expiry.lua +++ b/src/plugins/lua/bayes_expiry.lua @@ -119,8 +119,8 @@ end rspamd_config:add_on_load(function (_, ev_base, worker) local processed_symbols, expire_script_sha - -- Exit unless we're the first 'normal' worker - if not (worker:get_name() == 'normal' and worker:get_index() == 0) then return end + -- Exit unless we're the first 'controller' worker + if not (worker:get_name() == 'controller' and worker:get_index() == 0) then return end -- Persist mempool variable to statefile on shutdown rspamd_config:register_finish_script(function () local stamp = pool:get_variable(VAR_NAME, 'double') diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 2fbbff69b..67a5343e2 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -642,7 +642,7 @@ if opts['reporting'] == true then end rspamd_config:add_on_load(function(cfg, ev_base, worker) load_scripts(cfg, ev_base) - if not (worker:get_name() == 'normal' and worker:get_index() == 0) then return end + if not (worker:get_name() == 'controller' and worker:get_index() == 0) then return end local rresolver = rspamd_resolver.init(ev_base, rspamd_config) rspamd_config:register_finish_script(function () local stamp = pool:get_variable(VAR_NAME, 'double') diff --git a/src/plugins/lua/metric_exporter.lua b/src/plugins/lua/metric_exporter.lua index 4951e6594..d104c4b9b 100644 --- a/src/plugins/lua/metric_exporter.lua +++ b/src/plugins/lua/metric_exporter.lua @@ -169,8 +169,8 @@ end if not configure_metric_exporter() then return end rspamd_config:add_on_load(function (_, ev_base, worker) - -- Exit unless we're the first 'normal' worker - if not (worker:get_name() == 'normal' and worker:get_index() == 0) then return end + -- Exit unless we're the first 'controller' worker + if not (worker:get_name() == 'controller' and worker:get_index() == 0) then return end -- Persist mempool variable to statefile on shutdown rspamd_config:register_finish_script(function () local stamp = pool:get_variable(VAR_NAME, 'double')