]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Really execute on_terminate scripts for fuzzy worker
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 25 Jan 2025 14:25:27 +0000 (14:25 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 25 Jan 2025 14:25:27 +0000 (14:25 +0000)
src/fuzzy_storage.c
src/libserver/worker_util.c

index 1b20a208dfbd87eadf265c1706ff9aecb0643209..37d3f1ee1ea057e4caf10dd3ae2b829f975bd6d6 100644 (file)
@@ -61,7 +61,7 @@ worker_t fuzzy_worker = {
        "fuzzy",     /* Name */
        init_fuzzy,  /* Init function */
        start_fuzzy, /* Start function */
-       RSPAMD_WORKER_HAS_SOCKET | RSPAMD_WORKER_NO_STRICT_CONFIG,
+       RSPAMD_WORKER_HAS_SOCKET | RSPAMD_WORKER_NO_STRICT_CONFIG | RSPAMD_WORKER_FUZZY,
        RSPAMD_WORKER_SOCKET_UDP, /* UDP socket */
        RSPAMD_WORKER_VER         /* Version info */
 };
index 39e70e4ca34e2cc7ad0b6c8d8811307a851a810b..d0ac8d8d3aa9e263d2f8a73f49e5f856838e5b98 100644 (file)
@@ -167,7 +167,7 @@ static void
 rspamd_worker_terminate_handlers(struct rspamd_worker *w)
 {
        if (w->nconns == 0 &&
-               (!(w->flags & RSPAMD_WORKER_SCANNER) || w->srv->cfg->on_term_scripts == NULL)) {
+               (!(w->flags & (RSPAMD_WORKER_SCANNER | RSPAMD_WORKER_FUZZY)) || w->srv->cfg->on_term_scripts == NULL)) {
                /*
                 * We are here either:
                 * - No active connections are represented
@@ -190,7 +190,7 @@ rspamd_worker_terminate_handlers(struct rspamd_worker *w)
                        if (w->state != rspamd_worker_wait_final_scripts) {
                                w->state = rspamd_worker_wait_final_scripts;
 
-                               if ((w->flags & (RSPAMD_WORKER_SCANNER|RSPAMD_WORKER_FUZZY)) &&
+                               if ((w->flags & (RSPAMD_WORKER_SCANNER | RSPAMD_WORKER_FUZZY)) &&
                                        rspamd_worker_call_finish_handlers(w)) {
                                        msg_info("performing async finishing actions");
                                        w->state = rspamd_worker_wait_final_scripts;