diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-08 11:29:49 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-08 11:29:49 +0000 |
commit | 7901576f5efdceb97d7df60f6cd1125130d9f6d1 (patch) | |
tree | aedf6b444406ebfb48ce02998ad43269bea4586b /src/lua | |
parent | e4de17c54e1057fb92edcfd3159771ca075f1a12 (diff) | |
download | rspamd-7901576f5efdceb97d7df60f6cd1125130d9f6d1.tar.gz rspamd-7901576f5efdceb97d7df60f6cd1125130d9f6d1.zip |
[Minor] Stop periodics on terminate
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_config.c | 8 |
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); |