mirror of https://github.com/xwiki-labs/cryptpad
report http-worker RPC errors to the main process for logging
This commit is contained in:
parent
953c817c5b
commit
3f18a38714
|
@ -11,12 +11,7 @@ const DEFAULT_QUERY_TIMEOUT = 5000;
|
|||
const PID = process.pid;
|
||||
|
||||
const response = Util.response(function (errLabel, info) {
|
||||
// XXX handle error
|
||||
console.error({
|
||||
_: '// XXX',
|
||||
errLabel: errLabel,
|
||||
info: info,
|
||||
});
|
||||
Env.Log.error(errLabel, info);
|
||||
});
|
||||
|
||||
const guid = () => {
|
||||
|
@ -64,7 +59,7 @@ EVENTS.ENV_UPDATE = function (data /*, cb */) {
|
|||
}
|
||||
};
|
||||
|
||||
EVENTS.FLUSH_CACHE = function (data /*, cb */) { // XXX
|
||||
EVENTS.FLUSH_CACHE = function (data) {
|
||||
if (typeof(data) !== 'number') {
|
||||
return Log.error('INVALID_FRESH_KEY', data);
|
||||
}
|
||||
|
@ -443,12 +438,13 @@ nThen(function (w) {
|
|||
server.listen(3001, w()); // if (Env.httpSafePort) {...
|
||||
}
|
||||
server.on('upgrade', function (req, socket, head) {
|
||||
//console.log("This should only happen in a dev environment"); // XXX
|
||||
// TODO warn admins that websockets should only be proxied in this way in a dev environment
|
||||
// in production it's more efficient to have your reverse proxy (NGINX) directly forward
|
||||
// websocket traffic to the correct port (Env.websocketPort)
|
||||
wsProxy.upgrade(req, socket, head);
|
||||
});
|
||||
}).nThen(function () {
|
||||
// XXX inform the parent process that this worker is ready
|
||||
|
||||
// TODO inform the parent process that this worker is ready
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue