From a21784ce0dc6c66deeb85e50d612ae29df566a78 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 16 Feb 2017 13:16:53 +0000 Subject: [PATCH] [Minor] Forgotten in the previous commit --- src/worker.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/worker.c b/src/worker.c index 5995911b9..c611e0c39 100644 --- a/src/worker.c +++ b/src/worker.c @@ -80,11 +80,15 @@ rspamd_worker_finalize (gpointer user_data) struct rspamd_task *task = user_data; struct timeval tv = {.tv_sec = 0, .tv_usec = 0}; - msg_info_task ("finishing actions has been processed, terminating"); - event_base_loopexit (task->ev_base, &tv); - rspamd_session_destroy (task->s); + if (!(task->flags & RSPAMD_TASK_FLAG_PROCESSING)) { + msg_info_task ("finishing actions has been processed, terminating"); + event_base_loopexit (task->ev_base, &tv); + rspamd_session_destroy (task->s); - return TRUE; + return TRUE; + } + + return FALSE; } static gboolean -- 2.39.5