Skip to content

Commit

Permalink
Generate static config file with "default_timeout" option
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 20, 2015
1 parent 11b0bc5 commit ef2c0f8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bin/droonga-http-server-configure
Expand Up @@ -266,6 +266,27 @@ function setIntegerOption(name, message) {
});
}

function setFloatOption(name, message) {
return Q.Promise(function(resolve, reject, notify) {
if (!options.prompt) {
configValues[name] = options[name];
resolve();
}
else {
promptly.prompt(message + ' [' + options[name] + ']: ',
{ default: options[name],
retry: false },
function(error, value) {
value = parseFloat(value);
if (isNaN(value))
value = options[name];
configValues[name] = value;
resolve();
});
}
});
}

function setBooleanOption(name, message) {
return Q.Promise(function(resolve, reject, notify) {
if (!options.prompt) {
Expand Down Expand Up @@ -301,6 +322,7 @@ function tryResetConfigs() {
.then(function() { return setIntegerOption('droongaEnginePort', 'port number of the droonga-engine node'); })
.then(function() { return setStringOption('tag', 'tag of the droonga-engine node'); })
.then(function() { return setStringOption('defaultDataset', 'default dataset'); })
.then(function() { return setFloatOption('defaultTimeout', 'timeout for unresponsive connections (in seconds)'); })
.then(function() { return setStringOption('accessLogFile', 'path to the access log file'); })
.then(function() { return setStringOption('systemLogFile', 'path to the system log file'); })
.then(function() { return setStringOption('systemLogLevel',
Expand Down

0 comments on commit ef2c0f8

Please sign in to comment.