[Groonga-commit] droonga/express-droonga at 212e469 [master] Use meaningful constant name for default value

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Apr 20 15:00:35 JST 2015


YUKI Hiroshi	2015-04-20 15:00:35 +0900 (Mon, 20 Apr 2015)

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

  Message:
    Use meaningful constant name for default value

  Modified files:
    lib/adapter/api/droonga.js

  Modified: lib/adapter/api/droonga.js (+4 -2)
===================================================================
--- lib/adapter/api/droonga.js    2015-04-20 14:57:28 +0900 (4588d13)
+++ lib/adapter/api/droonga.js    2015-04-20 15:00:35 +0900 (8e456cd)
@@ -1,5 +1,7 @@
 var command = require('../command');
 
+var DEFAULT_TIMEOUT = 1000;
+
 function pathToMessageType(path) {
   return path
            .split('?')[0]
@@ -14,7 +16,7 @@ module.exports = {
     onRequest: function(request, connection) {
       var messageType = pathToMessageType(request.params[0]);
       var body = {};
-      body.timeout = body.timeout || 1000;
+      body.timeout = body.timeout || DEFAULT_TIMEOUT;
       connection.emit(messageType, body);
     }
   }),
@@ -30,7 +32,7 @@ module.exports = {
       });
       request.on('end', function() {
         body = JSON.parse(body);
-        body.timeout = body.timeout || 1000;
+        body.timeout = body.timeout || DEFAULT_TIMEOUT;
         body.type = body.type || 'droonga-' + messageType;
         connection.emit(messageType, body);
       });
-------------- next part --------------
HTML����������������������������...
Download 



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