From 79a6671de054b5f03eb4a9cb9b8851d3e111a295 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 20 Jun 2019 22:04:11 +0100 Subject: [PATCH] [Minor] Optimize the case when there are no finish events --- src/libserver/worker_util.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c index cc89c210b..bb15d0407 100644 --- a/src/libserver/worker_util.c +++ b/src/libserver/worker_util.c @@ -112,6 +112,11 @@ rspamd_worker_terminate_handlers (struct rspamd_worker *w) static ev_timer margin_call; static int nchecks = 0; + if (w->finish_actions->len == 0) { + /* Nothing to do */ + return; + } + actx = (struct rspamd_abstract_worker_ctx *)w->ctx; /* -- 2.39.5