Skip to content

Commit

Permalink
[Minor] Move settings symbol registration earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Aug 20, 2019
1 parent 35fd0d7 commit f28ae32
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/plugins/lua/settings.lua
Expand Up @@ -1106,6 +1106,14 @@ if redis_section then
end, redis_key_handlers)
end

module_sym_id = rspamd_config:register_symbol({
name = 'SETTINGS_CHECK',
type = 'prefilter',
callback = check_settings,
priority = 10,
flags = 'empty,nostat,explicit_disable,ignore_passthrough',
})

local set_section = rspamd_config:get_all_opt("settings")

if set_section and set_section[1] and type(set_section[1]) == "string" then
Expand All @@ -1118,14 +1126,6 @@ elseif set_section and type(set_section) == "table" then
process_settings_table(set_section, true, settings_map_pool)
end

module_sym_id = rspamd_config:register_symbol({
name = 'SETTINGS_CHECK',
type = 'prefilter',
callback = check_settings,
priority = 10,
flags = 'empty,nostat,explicit_disable,ignore_passthrough',
})

rspamd_config:add_config_unload(function()
if settings_map_pool then
settings_map_pool:destroy()
Expand Down

0 comments on commit f28ae32

Please sign in to comment.