Kouhei Sutou
null+****@clear*****
Wed Apr 6 14:24:23 JST 2016
Kouhei Sutou 2016-04-06 14:24:23 +0900 (Wed, 06 Apr 2016) New Revision: 94c4a9e45c002523b6ac8e30f799f425739f8576 https://github.com/groonga/groonga/commit/94c4a9e45c002523b6ac8e30f799f425739f8576 Message: groonga-httpd: support changing the default request timeout But it doesn't work yet. Because we don't implement request timer for groonga-httpd yet. Modified files: src/httpd/nginx-module/ngx_http_groonga_module.c Modified: src/httpd/nginx-module/ngx_http_groonga_module.c (+19 -1) =================================================================== --- src/httpd/nginx-module/ngx_http_groonga_module.c 2016-04-06 13:22:20 +0900 (82faebf) +++ src/httpd/nginx-module/ngx_http_groonga_module.c 2016-04-06 14:24:23 +0900 (3e17802) @@ -1,6 +1,6 @@ /* -*- c-basic-offset: 2 -*- */ /* - Copyright(C) 2012-2015 Brazil + Copyright(C) 2012-2016 Brazil This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -47,6 +47,7 @@ typedef struct { ngx_str_t query_log_path; ngx_open_file_t *query_log_file; size_t cache_limit; + ngx_msec_t default_request_timeout_msec; char *config_file; int config_line; char *name; @@ -339,6 +340,16 @@ ngx_http_groonga_context_init(ngx_http_groonga_loc_conf_t *location_conf, grn_ctx_use(context, location_conf->database); grn_cache_current_set(context, location_conf->cache); + /* TODO: It doesn't work yet. We need to implement request timeout + * handler. */ + if (location_conf->default_request_timeout_msec == NGX_CONF_UNSET_MSEC) { + grn_set_default_request_timeout(0.0); + } else { + double timeout; + timeout = location_conf->default_request_timeout_msec / 1000.0; + grn_set_default_request_timeout(timeout); + } + ngx_http_groonga_current_location_conf = location_conf; return status; @@ -1538,6 +1549,13 @@ static ngx_command_t ngx_http_groonga_commands[] = { offsetof(ngx_http_groonga_loc_conf_t, cache_limit), NULL }, + { ngx_string("groonga_default_request_timeout"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, + ngx_conf_set_msec_slot, + NGX_HTTP_LOC_CONF_OFFSET, + offsetof(ngx_http_groonga_loc_conf_t, default_request_timeout_msec), + NULL }, + ngx_null_command }; -------------- next part -------------- HTML����������������������������... ダウンロード