diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-14 14:07:30 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-14 14:07:30 +0100 |
commit | 203de2ba032b85924dd01076f72d21752a7a4f29 (patch) | |
tree | e5f33827f36c60feb3d168999c76700960497574 /src/libstat/stat_process.c | |
parent | c7cf4d68dbf5adb173f5a7391833cc9df8e2b4dd (diff) | |
download | rspamd-203de2ba032b85924dd01076f72d21752a7a4f29.tar.gz rspamd-203de2ba032b85924dd01076f72d21752a7a4f29.zip |
[Fix] Fix autolearning errors and redis cache
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r-- | src/libstat/stat_process.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index ed24499ba..993de3816 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -547,6 +547,16 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx, gint cb_ref; gchar *cond_str = NULL; + if ((task->flags & RSPAMD_TASK_FLAG_ALREADY_LEARNED) && err != NULL && + *err == NULL) { + /* Do not learn twice */ + g_set_error (err, rspamd_stat_quark (), 404, "<%s> has been already " + "learned as %s, ignore it", task->message_id, + spam ? "spam" : "ham"); + + return FALSE; + } + /* Check whether we have learned that file */ for (i = 0; i < st_ctx->classifiers->len; i ++) { cl = g_ptr_array_index (st_ctx->classifiers, i); |