Compare commits

...

1 Commits

Author SHA1 Message Date
Marcel Klehr 0a468e92b6 Use a node domain per message to stabilize the server 2013-03-23 22:22:14 +01:00
1 changed files with 91 additions and 82 deletions

View File

@ -35,6 +35,7 @@ var messageLogger = log4js.getLogger("message");
var accessLogger = log4js.getLogger("access");
var _ = require('underscore');
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks.js");
var domain = require("domain");
/**
* A associative array that saves informations about a session
@ -149,6 +150,13 @@ exports.handleMessage = function(client, message)
return;
}
var msgDomain = domain.create()
msgDomain.on('error', function(er) {
messageLogger.warn('Error in message:')
messageLogger.warn(er.stack? er.stack : er)
msgDomain.dispose()
})
msgDomain.run(function() {
var handleMessageHook = function(callback){
var dropMessage = false;
@ -234,6 +242,7 @@ exports.handleMessage = function(client, message)
finalHandler
]);
}
});
}