aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-08 11:29:49 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-08 11:29:49 +0000
commit7901576f5efdceb97d7df60f6cd1125130d9f6d1 (patch)
treeaedf6b444406ebfb48ce02998ad43269bea4586b /src/lua
parente4de17c54e1057fb92edcfd3159771ca075f1a12 (diff)
downloadrspamd-7901576f5efdceb97d7df60f6cd1125130d9f6d1.tar.gz
rspamd-7901576f5efdceb97d7df60f6cd1125130d9f6d1.zip
[Minor] Stop periodics on terminate
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 33873d8ab..b7bddc34b 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -3186,6 +3186,14 @@ lua_periodic_callback_finish (struct thread_entry *thread, int ret)
lua_pop (L, 1); /* Return value */
}
+
+ if (periodic->cfg->cur_worker) {
+ if (periodic->cfg->cur_worker->state != rspamd_worker_state_running) {
+ /* We are terminating, no more periodics */
+ plan_more = FALSE;
+ }
+ }
+
if (plan_more) {
if (periodic->need_jitter) {
timeout = rspamd_time_jitter (timeout, 0.0);