static ngx_int_t ngx_http_groonga_init_process(ngx_cycle_t *cycle) { grn_rc rc; ngx_http_conf_ctx_t *http_conf; ngx_http_groonga_database_callback_data_t data; rc = grn_init(); if (rc != GRN_SUCCESS) { return NGX_ERROR; } grn_set_segv_handler(); http_conf = (ngx_http_conf_ctx_t *)ngx_get_conf(cycle->conf_ctx, ngx_http_module); data.log = cycle->log; data.pool = cycle->pool; data.rc = NGX_OK; ngx_http_groonga_each_loc_conf(http_conf, ngx_http_groonga_open_database_callback, &data); return data.rc; }
static ngx_int_t ngx_http_groonga_init_process(ngx_cycle_t *cycle) { grn_rc rc; ngx_http_conf_ctx_t *http_conf; ngx_http_groonga_database_callback_data_t data; grn_thread_set_get_limit_func(ngx_http_groonga_get_thread_limit, NULL); #ifdef NGX_HTTP_GROONGA_LOG_PATH grn_default_logger_set_path(NGX_HTTP_GROONGA_LOG_PATH); #endif rc = grn_init(); if (rc != GRN_SUCCESS) { return NGX_ERROR; } grn_set_segv_handler(); rc = grn_ctx_init(context, GRN_NO_FLAGS); if (rc != GRN_SUCCESS) { return NGX_ERROR; } http_conf = (ngx_http_conf_ctx_t *)ngx_get_conf(cycle->conf_ctx, ngx_http_module); data.log = cycle->log; data.pool = cycle->pool; data.rc = NGX_OK; ngx_http_groonga_each_loc_conf(http_conf, ngx_http_groonga_open_database_callback, &data); return data.rc; }