From cbf7157e47e1e94d0653bc291767c2991e96158f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 8 Dec 2020 15:09:08 +0000 Subject: [Minor] Allow to skip composites second pass --- src/libserver/task.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/libserver/task.c') diff --git a/src/libserver/task.c b/src/libserver/task.c index 80216537f..096933803 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -756,6 +756,7 @@ rspamd_task_process (struct rspamd_task *task, guint stages) case RSPAMD_TASK_STAGE_COMPOSITES: rspamd_composites_process_task (task); + task->result->nresults_postfilters = task->result->nresults; break; case RSPAMD_TASK_STAGE_POST_FILTERS: @@ -813,8 +814,13 @@ rspamd_task_process (struct rspamd_task *task, guint stages) } break; case RSPAMD_TASK_STAGE_COMPOSITES_POST: - /* Second run of composites processing before idempotent filters */ - rspamd_composites_process_task (task); + /* Second run of composites processing before idempotent filters (if needed) */ + if (task->result->nresults_postfilters != task->result->nresults) { + rspamd_composites_process_task (task); + } + else { + msg_debug_task ("skip second run of composites as the result has not been changed"); + } break; case RSPAMD_TASK_STAGE_IDEMPOTENT: -- cgit v1.2.3