summaryrefslogtreecommitdiffstats
path: root/src/worker.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-18 01:07:11 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-18 01:07:11 +0000
commitdfbf2f58ee3f5f2481db498f006137eeb1dfdfb5 (patch)
tree732d71eebd5199f995f24614e5bd4e153e933c14 /src/worker.c
parentb4f959e150106634c75b4ca95e2f634f5b8946a6 (diff)
downloadrspamd-dfbf2f58ee3f5f2481db498f006137eeb1dfdfb5.tar.gz
rspamd-dfbf2f58ee3f5f2481db498f006137eeb1dfdfb5.zip
Rework hyperscan notifies to reduce noise level
Diffstat (limited to 'src/worker.c')
-rw-r--r--src/worker.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/worker.c b/src/worker.c
index 9c5f0bd40..7598c687f 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -293,13 +293,19 @@ rspamd_worker_hyperscan_ready (struct rspamd_main *rspamd_main,
gpointer ud)
{
struct rspamd_control_reply rep;
+ struct rspamd_re_cache *cache = worker->srv->cfg->re_cache;
- msg_info ("loading hyperscan expressions after receiving compilation notice");
memset (&rep, 0, sizeof (rep));
rep.type = RSPAMD_CONTROL_HYPERSCAN_LOADED;
- rep.reply.hs_loaded.status = rspamd_re_cache_load_hyperscan (
- worker->srv->cfg->re_cache, cmd->cmd.hs_loaded.cache_dir);
+ if (!rspamd_re_cache_is_hs_loaded (cache) || cmd->cmd.hs_loaded.forced) {
+ msg_info ("loading hyperscan expressions after receiving compilation "
+ "notice: %s",
+ (!rspamd_re_cache_is_hs_loaded (cache)) ?
+ "new db" : "forced update");
+ rep.reply.hs_loaded.status = rspamd_re_cache_load_hyperscan (
+ worker->srv->cfg->re_cache, cmd->cmd.hs_loaded.cache_dir);
+ }
if (write (fd, &rep, sizeof (rep)) != sizeof (rep)) {
msg_err ("cannot write reply to the control socket: %s",