[Groonga-commit] droonga/express-droonga at 6aef488 [master] Ignore error on "emit()" for each client socket

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Oct 21 12:14:14 JST 2013


YUKI Hiroshi	2013-10-21 12:14:14 +0900 (Mon, 21 Oct 2013)

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

  Message:
    Ignore error on "emit()" for each client socket

  Modified files:
    lib/adapter/socket.io.js

  Modified: lib/adapter/socket.io.js (+6 -1)
===================================================================
--- lib/adapter/socket.io.js    2013-10-18 15:22:03 +0900 (c88f581)
+++ lib/adapter/socket.io.js    2013-10-21 12:14:14 +0900 (5ee91c4)
@@ -139,8 +139,13 @@ exports.register = function(application, server, params) {
       subscribers = [subscribers];
     subscribers.forEach(function(subscriber) {
       subscriber = watchSubscribers[subscriber];
-      if (subscriber)
+      if (!subscriber)
+        return;
+      try {
         subscriber.emit('watch.notification', envelope.body);
+      } catch(exception) {
+        console.log(exception + '\n' + exception.stack);
+      }
     });
   };
   connection.on('watch.notification', watchNotificationHandler);
-------------- next part --------------
HTML����������������������������...
Download 



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