diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-18 01:07:11 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-18 01:07:11 +0000 |
commit | dfbf2f58ee3f5f2481db498f006137eeb1dfdfb5 (patch) | |
tree | 732d71eebd5199f995f24614e5bd4e153e933c14 /src/hs_helper.c | |
parent | b4f959e150106634c75b4ca95e2f634f5b8946a6 (diff) | |
download | rspamd-dfbf2f58ee3f5f2481db498f006137eeb1dfdfb5.tar.gz rspamd-dfbf2f58ee3f5f2481db498f006137eeb1dfdfb5.zip |
Rework hyperscan notifies to reduce noise level
Diffstat (limited to 'src/hs_helper.c')
-rw-r--r-- | src/hs_helper.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/hs_helper.c b/src/hs_helper.c index bf317cbbb..771d74d7a 100644 --- a/src/hs_helper.c +++ b/src/hs_helper.c @@ -176,7 +176,7 @@ rspamd_rs_compile (struct hs_helper_ctx *ctx, struct rspamd_worker *worker, } if ((ncompiled = rspamd_re_cache_compile_hyperscan (ctx->cfg->re_cache, - ctx->hs_dir, ctx->max_time, + ctx->hs_dir, ctx->max_time, !forced, &err)) == -1) { msg_err ("failed to compile re cache: %e", err); g_error_free (err); @@ -184,8 +184,11 @@ rspamd_rs_compile (struct hs_helper_ctx *ctx, struct rspamd_worker *worker, return FALSE; } - msg_info ("compiled %d regular expressions to the hyperscan tree", - ncompiled); + if (ncompiled > 0) { + msg_info ("compiled %d regular expressions to the hyperscan tree", + ncompiled); + forced = TRUE; + } /* * Do not send notification unless all other workers are started @@ -198,6 +201,7 @@ rspamd_rs_compile (struct hs_helper_ctx *ctx, struct rspamd_worker *worker, srv_cmd.type = RSPAMD_SRV_HYPERSCAN_LOADED; srv_cmd.cmd.hs_loaded.cache_dir = ctx->hs_dir; + srv_cmd.cmd.hs_loaded.forced = forced; rspamd_srv_send_command (worker, ctx->ev_base, &srv_cmd, NULL, NULL); |