[Groonga-commit] droonga/droonga-http-server at ef2c0f8 [master] Generate static config file with "default_timeout" option

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Apr 20 15:10:21 JST 2015


YUKI Hiroshi	2015-04-20 15:10:21 +0900 (Mon, 20 Apr 2015)

  New Revision: ef2c0f831a3048b766e506b6d6b2d85f6b2e77a9
  https://github.com/droonga/droonga-http-server/commit/ef2c0f831a3048b766e506b6d6b2d85f6b2e77a9

  Message:
    Generate static config file with "default_timeout" option

  Modified files:
    bin/droonga-http-server-configure

  Modified: bin/droonga-http-server-configure (+22 -0)
===================================================================
--- bin/droonga-http-server-configure    2015-04-20 15:07:46 +0900 (991a383)
+++ bin/droonga-http-server-configure    2015-04-20 15:10:21 +0900 (e72a222)
@@ -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) {
@@ -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',
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index