disconnect ws error event after promise resolves
This commit is contained in:
parent
4f68bbfd52
commit
f93693535e
1 changed files with 3 additions and 1 deletions
|
|
@ -322,11 +322,13 @@ export class StreamingApiServerService implements OnApplicationShutdown {
|
|||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
this.#wss.close(err => {
|
||||
this.#wss.off('error', this.onWsError);
|
||||
if (err) reject(err);
|
||||
else resolve();
|
||||
});
|
||||
});
|
||||
|
||||
// Don't disconnect this until *after* close returns
|
||||
this.#wss.off('error', this.onWsError);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue