[Groonga-commit] droonga/express-droonga at d3ea485 [master] Brush up detection of default timeout

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Apr 20 16:08:20 JST 2015


YUKI Hiroshi	2015-04-20 16:08:20 +0900 (Mon, 20 Apr 2015)

  New Revision: d3ea485e1977986b92c59f4788202f43226e527d
  https://github.com/droonga/express-droonga/commit/d3ea485e1977986b92c59f4788202f43226e527d

  Message:
    Brush up detection of default timeout

  Modified files:
    lib/droonga-protocol/connection.js

  Modified: lib/droonga-protocol/connection.js (+2 -8)
===================================================================
--- lib/droonga-protocol/connection.js    2015-04-20 16:04:36 +0900 (c90cc6c)
+++ lib/droonga-protocol/connection.js    2015-04-20 16:08:20 +0900 (3015168)
@@ -63,7 +63,7 @@ Connection.prototype._init = function() {
                           this._params.defaultDataset ||
                             '';
   this.defaultTimeout = this._params.defaultTimeout ||
-                          null;
+                          DEFAULT_RESPONSE_TIMEOUT_SECONDS;
   this.hostName = this._params.hostName ||
                           process.env.DROONGA_ENGINE_HOST ||
                             DEFAULT_FLUENT_HOST_NAME;
@@ -269,14 +269,8 @@ Connection.prototype.emitMessage = function(type, body, callback, options) {
       }
     }).bind(this));
 
-    if (typeof options.timeout == 'number') {
-      options.timeout = toFloat(options.timeout)
-    }
-    else {
-      options.timeout = DEFAULT_RESPONSE_TIMEOUT_SECONDS;
-    }
     if (options.timeout > -1) {
-      var timeoutMilliseconds = options.timeout * ONE_SECOND_IN_MILLISECONDS;
+      var timeoutMilliseconds = envelope.timeout * ONE_SECOND_IN_MILLISECONDS;
       timeoutId = setTimeout((function() {
         this._logger.trace('Connection timed out (message id: '+id+')');
         this.removeAllListeners(event);
-------------- next part --------------
HTML����������������������������...
Descargar 



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