diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-04-06 14:10:13 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-04-06 14:10:13 +0100 |
commit | fd05dc559036804f5a1c3503d957ac53ef5fcaa4 (patch) | |
tree | 4d8ab15ea150ffed3e35e77813920f4d8cc79ec4 /lualib | |
parent | a712c5da35167e06e99fc2b2e0057a3f680fd4fc (diff) | |
download | rspamd-fd05dc559036804f5a1c3503d957ac53ef5fcaa4.tar.gz rspamd-fd05dc559036804f5a1c3503d957ac53ef5fcaa4.zip |
[Minor] Rspamadm: Do a more deep initialisation for clickhouse subcommand
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/rspamadm/clickhouse.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lualib/rspamadm/clickhouse.lua b/lualib/rspamadm/clickhouse.lua index 711437c94..899fbd51c 100644 --- a/lualib/rspamadm/clickhouse.lua +++ b/lualib/rspamadm/clickhouse.lua @@ -19,6 +19,7 @@ local lua_clickhouse = require "lua_clickhouse" local lua_util = require "lua_util" local rspamd_http = require "rspamd_http" local rspamd_upstream_list = require "rspamd_upstream_list" +local rspamd_logger = require "rspamd_logger" local ucl = require "ucl" local E = {} @@ -133,8 +134,18 @@ local function load_config(config_file) local _r,err = rspamd_config:load_ucl(config_file) if not _r then - io.stderr:write(string.format('cannot parse %s: %s', - config_file, err)) + rspamd_logger.errx('cannot load %s: %s', config_file, err) + os.exit(1) + end + + _r,err = rspamd_config:parse_rcl({'logging', 'worker'}) + if not _r then + rspamd_logger.errx('cannot process %s: %s', config_file, err) + os.exit(1) + end + + if not rspamd_config:init_modules() then + rspamd_logger.errx('cannot init modules when parsing %s', config_file) os.exit(1) end end |