From a60d02d527b5af86dfc484b114fe607cc6674856 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 12 Nov 2021 12:27:01 +0000 Subject: [PATCH] [Minor] Allow to register preloads for external services --- src/plugins/lua/external_services.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/lua/external_services.lua b/src/plugins/lua/external_services.lua index 0157d15a9..02068685b 100644 --- a/src/plugins/lua/external_services.lua +++ b/src/plugins/lua/external_services.lua @@ -378,6 +378,15 @@ if opts and type(opts) == 'table' then group = group }) end + + -- Add preloads if a module requires that + if type(m.preloads) == 'table' then + for _,preload in ipairs(m.preloads) do + rspamd_config:add_on_load(function(cfg, ev_base, worker) + preload(m, cfg, ev_base, worker) + end) + end + end end end end -- 2.39.5