]> source.dussan.org Git - rspamd.git/commitdiff
[Rework] Re cache: Load compiled hyperscan in the main process as well
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 23 Mar 2020 16:01:28 +0000 (16:01 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 23 Mar 2020 16:01:28 +0000 (16:01 +0000)
src/libserver/rspamd_control.c

index cb2efecb953dfca4884be453dac482280eecfca0..1bb4ac4d6e38e3d634391a347848caa5f60101c9 100644 (file)
@@ -904,6 +904,14 @@ rspamd_srv_handler (EV_P_ ev_io *w, int revents)
                                }
                                break;
                        case RSPAMD_SRV_HYPERSCAN_LOADED:
+                               /* Load RE cache to provide it for new forks */
+                               if (rspamd_re_cache_is_hs_loaded (srv->cfg->re_cache) != RSPAMD_HYPERSCAN_LOADED_FULL ||
+                                               cmd.cmd.hs_loaded.forced) {
+                                       rspamd_re_cache_load_hyperscan (
+                                                       srv->cfg->re_cache,
+                                                       cmd.cmd.hs_loaded.cache_dir);
+                               }
+
                                /* Broadcast command to all workers */
                                memset (&wcmd, 0, sizeof (wcmd));
                                wcmd.type = RSPAMD_CONTROL_HYPERSCAN_LOADED;