diff options
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r-- | nginx/ngx_http_js_module.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index 40bb83a5..3b493bd1 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -7684,21 +7684,12 @@ ngx_http_js_init(ngx_conf_t *cf) static ngx_int_t -ngx_http_js_init_worker(ngx_cycle_t *cycle) +ngx_http_js_init_worker_periodics(ngx_js_main_conf_t *jmcf) { ngx_uint_t i; ngx_js_periodic_t *periodics; - ngx_js_main_conf_t *jmcf; - - if ((ngx_process != NGX_PROCESS_WORKER) - && ngx_process != NGX_PROCESS_SINGLE) - { - return NGX_OK; - } - - jmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_js_module); - if (jmcf == NULL || jmcf->periodics == NULL) { + if (jmcf->periodics == NULL) { return NGX_OK; } @@ -7726,6 +7717,31 @@ ngx_http_js_init_worker(ngx_cycle_t *cycle) } +static ngx_int_t +ngx_http_js_init_worker(ngx_cycle_t *cycle) +{ + ngx_js_main_conf_t *jmcf; + + if ((ngx_process != NGX_PROCESS_WORKER) + && ngx_process != NGX_PROCESS_SINGLE) + { + return NGX_OK; + } + + jmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_js_module); + + if (jmcf == NULL) { + return NGX_OK; + } + + if (ngx_http_js_init_worker_periodics(jmcf) != NGX_OK) { + return NGX_ERROR; + } + + return NGX_OK; +} + + static char * ngx_http_js_periodic(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { |