]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
plugins/old-stats: Add old-stats preinit() which opens mail stats io.
authorSergey Kitov <sergey.kitov@open-xchange.com>
Fri, 9 Mar 2018 13:17:29 +0000 (15:17 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 30 Apr 2018 13:49:27 +0000 (16:49 +0300)
src/plugins/stats/mail-stats-fill.c
src/plugins/stats/mail-stats.h
src/plugins/stats/stats-plugin.c
src/plugins/stats/stats-plugin.h

index f9933501d7af5a3ff6be180666819c3bc1bf5c81..4a24378d752b9cd974892095b25b773036a63ef3 100644 (file)
@@ -149,6 +149,11 @@ void mail_stats_fill(struct stats_user *suser, struct mail_stats *stats_r)
        user_trans_stats_get(suser, stats_r);
 }
 
+void mail_stats_global_preinit(void)
+{
+       (void)process_io_open();
+}
+
 void mail_stats_fill_global_deinit(void)
 {
        if (proc_io_fd != -1)
index fc536325e011757c072dc65bffcd0f638056d787..7254b696d0370197ceb58e805fe3ff2627b69cf0 100644 (file)
@@ -35,6 +35,7 @@ void mail_stats_fill(struct stats_user *suser, struct mail_stats *mail_stats);
 void mail_stats_add_transaction(struct mail_stats *stats,
                                const struct mailbox_transaction_stats *trans_stats);
 
+void mail_stats_global_preinit(void);
 void mail_stats_fill_global_deinit(void);
 
 #endif
index 7f585a00a57df6d72fc1424778568e27dba58ece..aed8d8beae868411fa8d6d4c44322f8514b757fa 100644 (file)
@@ -466,6 +466,11 @@ void stats_plugin_init(struct module *module)
        mail_storage_hooks_add(module, &stats_mail_storage_hooks);
 }
 
+void stats_plugin_preinit(void)
+{
+       mail_stats_global_preinit();
+}
+
 void stats_plugin_deinit(void)
 {
        if (global_stats_conn != NULL)
index bbf437fa293467455ba27d9d7048b54e740cd7aa..d13b7c3df7307e916d53453615f3566546ce5452 100644 (file)
@@ -51,6 +51,7 @@ extern MODULE_CONTEXT_DEFINE(stats_user_module, &mail_user_module_register);
 extern MODULE_CONTEXT_DEFINE(stats_storage_module, &mail_storage_module_register);
 
 void stats_plugin_init(struct module *module);
+void stats_plugin_preinit(void);
 void stats_plugin_deinit(void);
 
 #endif