From: Dmitry Volyntsev Date: Thu, 31 Aug 2023 03:59:11 +0000 (-0700) Subject: Fixed js_periodic handler stopping after graceful shutdown. X-Git-Tag: 0.8.1~12 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/postgres_fdw.c?a=commitdiff_plain;h=3b53739a550680c33d0dd33ba1b7cb2587b6d5db;p=njs.git Fixed js_periodic handler stopping after graceful shutdown. The issue was introduced in f1bd0b1db065. --- 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;