diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-24 16:47:22 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-24 16:47:22 +0100 |
commit | 413e08bb4f8dd7e85e5bc86b15751d1789553fe3 (patch) | |
tree | 972c17f9d15d3dd2dd41736f5de2f30a006c9944 /src/rspamd.c | |
parent | a7de52f40cc625c6f0e714f889dfddabc2968269 (diff) | |
download | rspamd-413e08bb4f8dd7e85e5bc86b15751d1789553fe3.tar.gz rspamd-413e08bb4f8dd7e85e5bc86b15751d1789553fe3.zip |
[Feature] Allow to skip some initialization phases to speed up rspamadm
Diffstat (limited to 'src/rspamd.c')
-rw-r--r-- | src/rspamd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rspamd.c b/src/rspamd.c index eaf6c6d30..cb8eb1806 100644 --- a/src/rspamd.c +++ b/src/rspamd.c @@ -68,7 +68,7 @@ static gboolean load_rspamd_config (struct rspamd_main *rspamd_main, struct rspamd_config *cfg, gboolean init_modules, - gboolean validate); + enum rspamd_post_load_options opts); /* Control socket */ static gint control_fd; @@ -280,7 +280,7 @@ reread_config (struct rspamd_main *rspamd_main) /* Save some variables */ tmp_cfg->cfg_name = cfg_file; - if (!load_rspamd_config (rspamd_main, tmp_cfg, FALSE, TRUE)) { + if (!load_rspamd_config (rspamd_main, tmp_cfg, FALSE, RSPAMD_CONFIG_INIT_VALIDATE)) { rspamd_set_logger (rspamd_main->cfg, g_quark_try_string ( "main"), rspamd_main); msg_err_main ("cannot parse new config file, revert to old one"); @@ -749,7 +749,8 @@ reopen_log_handler (gpointer key, gpointer value, gpointer unused) static gboolean load_rspamd_config (struct rspamd_main *rspamd_main, - struct rspamd_config *cfg, gboolean init_modules, gboolean validate) + struct rspamd_config *cfg, gboolean init_modules, + enum rspamd_post_load_options opts) { cfg->compiled_modules = modules; cfg->compiled_workers = workers; @@ -782,7 +783,7 @@ load_rspamd_config (struct rspamd_main *rspamd_main, } /* Do post-load actions */ - rspamd_config_post_load (cfg, validate); + rspamd_config_post_load (cfg, opts); return TRUE; } @@ -1120,7 +1121,7 @@ main (gint argc, gchar **argv, gchar **env) } if (config_test || dump_cache) { - if (!load_rspamd_config (rspamd_main, rspamd_main->cfg, FALSE, FALSE)) { + if (!load_rspamd_config (rspamd_main, rspamd_main->cfg, FALSE, 0)) { exit (EXIT_FAILURE); } @@ -1146,7 +1147,8 @@ main (gint argc, gchar **argv, gchar **env) } /* Load config */ - if (!load_rspamd_config (rspamd_main, rspamd_main->cfg, TRUE, TRUE)) { + if (!load_rspamd_config (rspamd_main, rspamd_main->cfg, TRUE, + RSPAMD_CONFIG_LOAD_ALL)) { exit (EXIT_FAILURE); } |