diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2013-01-08 18:24:24 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2013-01-08 18:24:24 +0400 |
commit | 3ac18652e5190623b1c36dd45a5684ca809acd3c (patch) | |
tree | 97a46e30be0f6915d506dad439b66c4e3f07ae00 /src/main.c | |
parent | 5bf70b4761c7df13ec8271ee0a50068531ffbc80 (diff) | |
download | rspamd-3ac18652e5190623b1c36dd45a5684ca809acd3c.tar.gz rspamd-3ac18652e5190623b1c36dd45a5684ca809acd3c.zip |
Add locking for maps.
Add ability to save rolling history in a file.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index c450500ad..e50b223aa 100644 --- a/src/main.c +++ b/src/main.c @@ -1093,6 +1093,11 @@ main (gint argc, gchar **argv, gchar **env) /* Preload all statfiles */ preload_statfiles (rspamd_main); + /* Maybe read roll history */ + if (rspamd_main->cfg->history_file) { + rspamd_roll_history_load (rspamd_main->history, rspamd_main->cfg->history_file); + } + /* Spawn workers */ rspamd_main->workers = g_hash_table_new (g_direct_hash, g_direct_equal); spawn_workers (rspamd_main); @@ -1181,6 +1186,11 @@ main (gint argc, gchar **argv, gchar **env) /* Wait for workers termination */ g_hash_table_foreach_remove (rspamd_main->workers, wait_for_workers, NULL); + /* Maybe save roll history */ + if (rspamd_main->cfg->history_file) { + rspamd_roll_history_save (rspamd_main->history, rspamd_main->cfg->history_file); + } + msg_info ("terminating..."); statfile_pool_delete (rspamd_main->statfile_pool); |