aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/task.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-12-08 15:09:08 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-12-08 15:09:08 +0000
commitcbf7157e47e1e94d0653bc291767c2991e96158f (patch)
treea46132847f6a3a9e02ea37d532dca191edefed24 /src/libserver/task.c
parenta0223f6333bb55428c6369f857d354c956a58a01 (diff)
downloadrspamd-cbf7157e47e1e94d0653bc291767c2991e96158f.tar.gz
rspamd-cbf7157e47e1e94d0653bc291767c2991e96158f.zip
[Minor] Allow to skip composites second pass
Diffstat (limited to 'src/libserver/task.c')
-rw-r--r--src/libserver/task.c10
1 files changed, 8 insertions, 2 deletions
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: