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:
@@ -13,10 +13,12 @@ export class WSAdapter extends WSSAdapter {
|
||||
|
||||
onListen() {}
|
||||
onConnection(ws) {}
|
||||
onError(error) {}
|
||||
start() {
|
||||
const wss = new WebSocketServer({ server: this.options.server });
|
||||
wss.on('listening', this.onListen);
|
||||
wss.on('connection', this.onConnection);
|
||||
wss.on('error', this.onError);
|
||||
}
|
||||
close() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user