summaryrefslogtreecommitdiffstats
path: root/src/rspamd.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-04-29 16:21:56 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-04-29 16:23:51 +0100
commit12f965bf98a0c89b67d132c2a5ec196378c49893 (patch)
tree60f7f156017ab1ce1f9eadd59301ce4b034f8add /src/rspamd.c
parentc3e5d3d6fc58322fa41dc787fcf4cd32dfe72f22 (diff)
downloadrspamd-12f965bf98a0c89b67d132c2a5ec196378c49893.tar.gz
rspamd-12f965bf98a0c89b67d132c2a5ec196378c49893.zip
[Fix] Allow to set 0 as number of rows to disable roll history
Issue: #4947 Closes: #4947
Diffstat (limited to 'src/rspamd.c')
-rw-r--r--src/rspamd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rspamd.c b/src/rspamd.c
index 8d4c83a28..dc5535f0c 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -1532,7 +1532,8 @@ int main(int argc, char **argv, char **env)
/* Create rolling history */
rspamd_main->history = rspamd_roll_history_new(rspamd_main->server_pool,
- rspamd_main->cfg->history_rows, rspamd_main->cfg);
+ rspamd_main->cfg->history_rows,
+ rspamd_main->cfg);
msg_info_main("rspamd " RVERSION
" is starting, build id: " RID);
@@ -1609,7 +1610,7 @@ int main(int argc, char **argv, char **env)
}
/* Maybe read roll history */
- if (rspamd_main->cfg->history_file) {
+ if (rspamd_main->history && rspamd_main->cfg->history_file) {
rspamd_roll_history_load(rspamd_main->history,
rspamd_main->cfg->history_file);
}
@@ -1692,7 +1693,7 @@ int main(int argc, char **argv, char **env)
ev_loop(event_loop, 0);
/* Maybe save roll history */
- if (rspamd_main->cfg->history_file) {
+ if (rspamd_main->history && rspamd_main->cfg->history_file) {
rspamd_roll_history_save(rspamd_main->history,
rspamd_main->cfg->history_file);
}