[Groonga-commit] droonga/express-droonga at 60e53cc [master] Start to connect the backend only when the server is correctly started

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Nov 7 12:09:06 JST 2014


YUKI Hiroshi	2014-11-07 12:09:06 +0900 (Fri, 07 Nov 2014)

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

  Message:
    Start to connect the backend only when the server is correctly started

  Modified files:
    index.js

  Modified: index.js (+5 -2)
===================================================================
--- index.js    2014-11-05 17:18:02 +0900 (51e523c)
+++ index.js    2014-11-07 12:09:06 +0900 (30dc0d3)
@@ -39,8 +39,11 @@ function droonga(application, params) {
   application.connectionPool = connectionPool;
 
   if (params.syncHostNames &&
-      typeof connectionPool.startSyncHostNamesFromCluster == 'function')
-    connectionPool.startSyncHostNamesFromCluster();
+      typeof connectionPool.startSyncHostNamesFromCluster == 'function') {
+    params.server.on('listening', function() {
+      connectionPool.startSyncHostNamesFromCluster();
+    });
+  }
 }
 
 exports.initialize = droonga;
-------------- next part --------------
HTML����������������������������...
下載 



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