From 3b53739a550680c33d0dd33ba1b7cb2587b6d5db Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Wed, 30 Aug 2023 20:59:11 -0700 Subject: [PATCH] Fixed js_periodic handler stopping after graceful shutdown. The issue was introduced in f1bd0b1db065. --- nginx/ngx_http_js_module.c | 4 ++++ nginx/ngx_stream_js_module.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index a1d54bdb..7499ff84 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -4102,6 +4102,10 @@ ngx_http_js_periodic_handler(ngx_event_t *ev) ngx_http_request_t *r; ngx_http_connection_t hc; + if (ngx_terminate || ngx_exiting) { + return; + } + periodic = ev->data; timer = periodic->interval; diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c index ab66de9d..8a0d6451 100644 --- a/nginx/ngx_stream_js_module.c +++ b/nginx/ngx_stream_js_module.c @@ -1815,6 +1815,10 @@ ngx_stream_js_periodic_handler(ngx_event_t *ev) ngx_stream_session_t *s; ngx_stream_core_main_conf_t *cmcf; + if (ngx_terminate || ngx_exiting) { + return; + } + periodic = ev->data; timer = periodic->interval; -- 2.47.3