diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-10-16 11:27:11 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-10-16 11:27:11 +0100 |
commit | 28302c84ef7c9ecdb4845b445d5ebba4c1ef204f (patch) | |
tree | 221848a4d158a4651a2f8105f862720b610ab654 | |
parent | 9dd4a6651a1b8753cf40bafb40d6903dd4c862ba (diff) | |
download | rspamd-28302c84ef7c9ecdb4845b445d5ebba4c1ef204f.tar.gz rspamd-28302c84ef7c9ecdb4845b445d5ebba4c1ef204f.zip |
[Fix] Restore propagation of spam/ham learns
-rw-r--r-- | src/libstat/stat_internal.h | 10 | ||||
-rw-r--r-- | src/libstat/stat_process.c | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/libstat/stat_internal.h b/src/libstat/stat_internal.h index 96d67cbf6..663c39df5 100644 --- a/src/libstat/stat_internal.h +++ b/src/libstat/stat_internal.h @@ -1,11 +1,11 @@ -/*- - * Copyright 2016 Vsevolod Stakhov +/* + * Copyright 2024 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -41,8 +41,8 @@ struct rspamd_classifier { GArray *statfiles_ids; /* int */ struct rspamd_stat_cache *cache; gpointer cachecf; - gulong spam_learns; - gulong ham_learns; + guint64 spam_learns; + guint64 ham_learns; int autolearn_cbref; struct rspamd_classifier_config *cfg; struct rspamd_stat_classifier *subrs; diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index 5db3af6ce..17caf4cc6 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -1017,6 +1017,9 @@ rspamd_stat_check_autolearn(struct rspamd_task *task) cl = g_ptr_array_index(st_ctx->classifiers, i); ret = FALSE; + rspamd_mempool_set_variable(task->task_pool, RSPAMD_MEMPOOL_HAM_LEARNS, (void *) &cl->ham_learns, NULL); + rspamd_mempool_set_variable(task->task_pool, RSPAMD_MEMPOOL_SPAM_LEARNS, (void *) &cl->spam_learns, NULL); + if (cl->cfg->opts) { obj = ucl_object_lookup(cl->cfg->opts, "autolearn"); |