return settings
end
-local function register_settings_id(str, settings)
+local function register_settings_id(str, settings, from_postload)
local numeric_id = numeric_settings_id(str)
if known_ids[numeric_id] then
}
end
- if not post_init_added then
- rspamd_config:add_post_init(function () register_settings_cb(true) end)
+ if not from_postload and not post_init_added then
+ -- Use high priority to ensure that settings are initialised early but not before all
+ -- plugins are loaded
+ rspamd_config:add_post_init(function () register_settings_cb(true) end, 150)
rspamd_config:add_config_unload(function()
if post_init_added then
known_ids = {}
return default_symbols
end
+exports.load_all_settings = register_settings_cb
+
return exports
\ No newline at end of file
end
if elt['id'] then
- out.id = lua_settings.register_settings_id(elt.id, out)
+ -- We are here from a postload script
+ out.id = lua_settings.register_settings_id(elt.id, out, true)
lua_util.debugm(N, rspamd_config,
'added settings id to "%s": %s -> %s',
name, elt.id, out.id)
end
settings_initialized = true
+ lua_settings.load_all_settings(true)
rspamd_logger.infox(rspamd_config, 'loaded %1 elements of settings', nrules)
return true
)
rspamd_config:add_post_init(function ()
process_settings_table(set_section, true, settings_map_pool, true)
- end)
+ end, 100)
end
rspamd_config:add_config_unload(function()