]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Optimize the case when there are no finish events
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 20 Jun 2019 21:04:11 +0000 (22:04 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 Jun 2019 09:57:29 +0000 (10:57 +0100)
src/libserver/worker_util.c

index cc89c210b931cbd21ae0d481b325dd429ef1a7c8..bb15d0407a095e4d92e866e8cbec67c0a7bf0678 100644 (file)
@@ -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;
 
        /*