aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_settings.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-12-28 20:39:43 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-12-28 20:40:06 +0000
commit00c154271407b00de368dfc91e6d1cb857a0d712 (patch)
tree82f5b4aa15999b4a5dfd11380796654601650f02 /lualib/lua_settings.lua
parent515d76b75018ab70d4f3412e1d9385e591b5aaa9 (diff)
downloadrspamd-00c154271407b00de368dfc91e6d1cb857a0d712.tar.gz
rspamd-00c154271407b00de368dfc91e6d1cb857a0d712.zip
[Fix] Try to move setings initialisation to a later stage
Diffstat (limited to 'lualib/lua_settings.lua')
-rw-r--r--lualib/lua_settings.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/lualib/lua_settings.lua b/lualib/lua_settings.lua
index b08b8c14e..5779cea85 100644
--- a/lualib/lua_settings.lua
+++ b/lualib/lua_settings.lua
@@ -31,7 +31,7 @@ local fun = require "fun"
local lua_util = require "lua_util"
local rspamd_logger = require "rspamd_logger"
-local function register_settings_cb()
+local function register_settings_cb(from_postload)
if not post_init_performed then
all_symbols = rspamd_config:get_symbols()
@@ -249,7 +249,7 @@ local function register_settings_id(str, settings)
end
if not post_init_added then
- rspamd_config:add_post_init(register_settings_cb)
+ rspamd_config:add_post_init(function () register_settings_cb(true) end)
rspamd_config:add_config_unload(function()
if post_init_added then
known_ids = {}
@@ -269,7 +269,7 @@ exports.register_settings_id = register_settings_id
local function settings_by_id(id)
if not post_init_performed then
- register_settings_cb()
+ register_settings_cb(false)
end
return known_ids[id]
end
@@ -278,20 +278,20 @@ end
exports.settings_by_id = settings_by_id
exports.all_settings = function()
if not post_init_performed then
- register_settings_cb()
+ register_settings_cb(false)
end
return known_ids
end
exports.all_symbols = function()
if not post_init_performed then
- register_settings_cb()
+ register_settings_cb(false)
end
return all_symbols
end
-- What is enabled when no settings are there
exports.default_symbols = function()
if not post_init_performed then
- register_settings_cb()
+ register_settings_cb(false)
end
return default_symbols
end