]> source.dussan.org Git - rspamd.git/commitdiff
Move statistics initialization to start of workers.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Jul 2015 08:31:33 +0000 (09:31 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Jul 2015 08:31:33 +0000 (09:31 +0100)
src/controller.c
src/libserver/cfg_utils.c
src/main.c
src/worker.c

index aa45f5c91228ed1c753a12824679b776c3805907..5f8710132405d652700ddb266c440cbb7b4f4213 100644 (file)
@@ -1966,6 +1966,7 @@ start_controller_worker (struct rspamd_worker *worker)
        /* Maps events */
        rspamd_map_watch (worker->srv->cfg, ctx->ev_base);
        rspamd_symbols_cache_start_refresh (worker->srv->cfg->cache, ctx->ev_base);
+       rspamd_stat_init (worker->srv->cfg);
 
        event_base_loop (ctx->ev_base, 0);
 
index 1ba6b2555e2d5eb25aafe4f0f2a1ec5de82cf9a8..0c9e51ed869e1cb6e72b583b8d52822de77baa7b 100644 (file)
@@ -411,7 +411,6 @@ rspamd_config_post_load (struct rspamd_config *cfg)
        (void)rspamd_lua_post_load_config (cfg);
        init_dynamic_config (cfg);
 
-       rspamd_stat_init (cfg);
        rspamd_url_init (cfg->tld_file);
 
        /* Insert classifiers symbols */
index dfd6182d811670069e7133b8e76b733a769796d5..58fc3f7e6b3431c8cd137216222924386f1a9f58 100644 (file)
@@ -1361,7 +1361,6 @@ main (gint argc, gchar **argv, gchar **env)
 
        msg_info ("terminating...");
        rspamd_symbols_cache_destroy (rspamd_main->cfg->cache);
-       rspamd_stat_close ();
        rspamd_log_close (rspamd_main->logger);
        rspamd_config_free (rspamd_main->cfg);
        g_free (rspamd_main->cfg);
index ba322d51e627f50290ec3303d7961a4298f41f48..b935accf444e90c1486c3a794c2984345ae054fc 100644 (file)
@@ -37,6 +37,7 @@
 #include "libmime/message.h"
 #include "main.h"
 #include "keypairs_cache.h"
+#include "libstat/stat_api.h"
 
 #include "lua/lua_common.h"
 
@@ -301,6 +302,7 @@ start_worker (struct rspamd_worker *worker)
 
        /* XXX: stupid default */
        ctx->keys_cache = rspamd_keypair_cache_new (256);
+       rspamd_stat_init (worker->srv->cfg);
 
        event_base_loop (ctx->ev_base, 0);