Improve WebSocketServer Error Handling (#6230)
* Improve WebSocketServer Error Handling Closes: https://github.com/parse-community/parse-server/issues/6173 Prevents an unhandled server rejection. Includes an example for LiveQuery test and closing the proper connections. Improve live query monitoring * fix tests
This commit is contained in:
@@ -392,6 +392,8 @@ class ParseLiveQueryServer {
|
||||
event: 'ws_disconnect',
|
||||
clients: this.clients.size,
|
||||
subscriptions: this.subscriptions.size,
|
||||
useMasterKey: client.hasMasterKey,
|
||||
installationId: client.installationId,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@ export class ParseWebSocketServer {
|
||||
}
|
||||
}, config.websocketTimeout || 10 * 1000);
|
||||
};
|
||||
wss.onError = error => {
|
||||
logger.error(error);
|
||||
};
|
||||
wss.start();
|
||||
this.server = wss;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user