YUKI Hiroshi
null+****@clear*****
Mon Apr 20 15:07:46 JST 2015
YUKI Hiroshi 2015-04-20 15:07:46 +0900 (Mon, 20 Apr 2015) New Revision: 11b0bc55a20319e8103cb25e0953772fa080676c https://github.com/droonga/droonga-http-server/commit/11b0bc55a20319e8103cb25e0953772fa080676c Message: Accept "--default-timeout" option for connections with engines Modified files: lib/default-configs.js lib/option-utils.js lib/server-options.js Modified: lib/default-configs.js (+1 -0) =================================================================== --- lib/default-configs.js 2015-04-10 11:40:18 +0900 (8d6a047) +++ lib/default-configs.js 2015-04-20 15:07:46 +0900 (0ebcb24) @@ -91,6 +91,7 @@ function defineDefaultConfigs(configs) { // node and it is guaranteed that this computer can be accessed with // the host name. define(configs, 'engine.receive_host', engineConfigs.host); + define(configs, 'engine.default_timeout', engineConfigs.default_timeout); return configs; } Modified: lib/option-utils.js (+5 -0) =================================================================== --- lib/option-utils.js 2015-04-10 11:40:18 +0900 (0f06d73) +++ lib/option-utils.js 2015-04-20 15:07:46 +0900 (b5bdcc2) @@ -21,6 +21,11 @@ function intOption(newValue, oldValue) { } exports.intOption = intOption; +function floatOption(newValue, oldValue) { + return parseFloat(newValue); +} +exports.floatOption = floatOption; + function stringsOption(newValue, oldValue) { return normalizeStringArray(newValue); } Modified: lib/server-options.js (+4 -0) =================================================================== --- lib/server-options.js 2015-04-10 11:40:18 +0900 (9fab471) +++ lib/server-options.js 2015-04-20 15:07:46 +0900 (7a2683a) @@ -23,6 +23,7 @@ options.droongaEnginePort = defaultConfigs.engine.port; options.tag = defaultConfigs.engine.tag; options.defaultDataset = defaultConfigs.engine.default_dataset; options.receiveHostName = defaultConfigs.engine.receive_host; +options.defaultTimeout = defaultConfigs.engine.default_timeout; function generateOptionHandler(onHandle, converter) { return function(newValue, oldValue) { @@ -67,6 +68,9 @@ function define() { 'The default dataset (' + options.defaultDataset + ')'); add('--tag <tag>', 'The tag (' + options.tag + ')'); + add('--default-timeout <timeout>', + 'Time to terminate unresponsive connections (in seconds) (' + options.defaultTimeout + ')', + optionUtils.floatOption); add('--access-log-file <file>', 'Output access logs to <file>. ' + 'You can use "-" as <file> to output to the standard output. ' + -------------- next part -------------- HTML����������������������������... 다운로드