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;
}
}
+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)
{
static ngx_int_t
-ngx_stream_js_init_worker(ngx_cycle_t *cycle)
+ngx_stream_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;
- }
+ ngx_uint_t i;
+ ngx_js_periodic_t *periodics;
- jmcf = ngx_stream_cycle_get_module_main_conf(cycle, ngx_stream_js_module);
-
- if (jmcf == NULL || jmcf->periodics == NULL) {
+ if (jmcf->periodics == NULL) {
return NGX_OK;
}
}
+static ngx_int_t
+ngx_stream_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_stream_cycle_get_module_main_conf(cycle, ngx_stream_js_module);
+
+ if (jmcf == NULL) {
+ return NGX_OK;
+ }
+
+ if (ngx_stream_js_init_worker_periodics(jmcf) != NGX_OK) {
+ return NGX_ERROR;
+ }
+
+ return NGX_OK;
+}
+
+
static char *
ngx_stream_js_periodic(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{