aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-04-20 17:39:12 +0600
committerGitHub <noreply@github.com>2024-04-20 17:39:12 +0600
commitd24265cb62e8c7b5b0fa83f14af2544b10448c3b (patch)
tree5d4162b9eeb7eb89192d85a991c7a3af78909497
parentb4b373907440f9703b4408654f490f751e5eb43d (diff)
parent6cf9ca1f978c3da18917e745268e5f01091ac55b (diff)
downloadrspamd-d24265cb62e8c7b5b0fa83f14af2544b10448c3b.tar.gz
rspamd-d24265cb62e8c7b5b0fa83f14af2544b10448c3b.zip
Merge pull request #4932 from rspamd/vstakhov-fix-bayes-disable
Fix statfile symbols disabling
-rw-r--r--src/libstat/stat_process.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 7f62d4e2a..33b7053f8 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -329,6 +329,18 @@ rspamd_stat_preprocess(struct rspamd_stat_ctx *st_ctx,
g_ptr_array_index(task->stat_runtimes, i) = NULL;
msg_debug_bayes("symbol %s is disabled, skip classification",
st->stcf->symbol);
+ /* We need to disable the whole classifier for this! */
+ struct rspamd_classifier *cl = st->classifier;
+ for (int j = 0; j < st_ctx->statfiles->len; j++) {
+ struct rspamd_statfile *nst = g_ptr_array_index(st_ctx->statfiles, j);
+
+ if (st != nst && nst->classifier == cl) {
+ g_ptr_array_index(task->stat_runtimes, j) = NULL;
+ msg_debug_bayes("symbol %s is disabled, skip classification for %s as well",
+ st->stcf->symbol, nst->stcf->symbol);
+ }
+ }
+
continue;
}