diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-06 22:27:44 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-06 22:27:44 +0000 |
commit | 9a834efa3617a01e0eb0ebf36b86f6e2c79bdc46 (patch) | |
tree | ee7b3a919613bc3249ad2a259f69f30ff17e93e9 | |
parent | 96fdcd7cc836df8b6ea99ca0551aab4adfe6179b (diff) | |
download | rspamd-9a834efa3617a01e0eb0ebf36b86f6e2c79bdc46.tar.gz rspamd-9a834efa3617a01e0eb0ebf36b86f6e2c79bdc46.zip |
Do not treat autolearn errors as fatal
-rw-r--r-- | src/libserver/task.c | 5 | ||||
-rw-r--r-- | src/libserver/task.h | 1 | ||||
-rw-r--r-- | src/libstat/stat_process.c | 4 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c index bee7df22d..fe7d490c2 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -466,8 +466,11 @@ rspamd_task_process (struct rspamd_task *task, guint stages) task->flags & RSPAMD_TASK_FLAG_LEARN_SPAM, task->cfg->lua_state, task->classifier, st, &stat_error)) { + + if (!(task->flags & RSPAMD_TASK_FLAG_LEARN_AUTO)) { + task->err = stat_error; + } msg_err_task ("learn error: %e", stat_error); - task->err = stat_error; task->processed_stages |= RSPAMD_TASK_STAGE_DONE; } } diff --git a/src/libserver/task.h b/src/libserver/task.h index 7ede95b31..d64d6461c 100644 --- a/src/libserver/task.h +++ b/src/libserver/task.h @@ -115,6 +115,7 @@ enum rspamd_task_stage { #define RSPAMD_TASK_FLAG_ALREADY_LEARNED (1 << 15) #define RSPAMD_TASK_FLAG_LEARN_SPAM (1 << 16) #define RSPAMD_TASK_FLAG_LEARN_HAM (1 << 17) +#define RSPAMD_TASK_FLAG_LEARN_AUTO (1 << 18) #define RSPAMD_TASK_IS_SKIPPED(task) (((task)->flags & RSPAMD_TASK_FLAG_SKIP)) #define RSPAMD_TASK_IS_JSON(task) (((task)->flags & RSPAMD_TASK_FLAG_JSON)) diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index 6635f8aa7..4045951eb 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -707,6 +707,10 @@ rspamd_stat_check_autolearn (struct rspamd_task *task) } } + if (ret) { + task->flags |= RSPAMD_TASK_FLAG_LEARN_AUTO; + } + return ret; } |