diff options
-rw-r--r-- | src/libstat/stat_process.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index fe64eb65b..9d4c3c7f9 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -536,6 +536,14 @@ rspamd_stat_backends_learn (struct rspamd_stat_ctx *st_ctx, res = FALSE; } + else { + if (!!spam == !!st->stcf->is_spam) { + st->backend->inc_learns (task, bk_run, st_ctx); + } + else { + st->backend->dec_learns (task, bk_run, st_ctx); + } + } } } @@ -576,23 +584,6 @@ rspamd_stat_backends_post_learn (struct rspamd_stat_ctx *st_ctx, continue; } - if (!task->flags & RSPAMD_TASK_FLAG_UNLEARN) { - if (!!spam != !!st->stcf->is_spam) { - /* If we are not unlearning, then do not touch another class */ - continue; - } - - st->backend->inc_learns (task, bk_run, st_ctx); - } - else { - if (!!spam == !!st->stcf->is_spam) { - st->backend->inc_learns (task, bk_run, st_ctx); - } - else { - st->backend->dec_learns (task, bk_run, st_ctx); - } - } - st->backend->finalize_learn (task, bk_run, st_ctx); } } |