Fix async context loss in WebSocketBus
This commit is contained in:
@@ -154,8 +154,10 @@ export class WebSocketBus implements EventBus, AwareOfContainerLifecycle {
|
||||
})
|
||||
})
|
||||
|
||||
this.ws.on('close', () => this.bus.push(new WebSocketCloseEvent()))
|
||||
this.ws.on('error', () => this.bus.push(new WebSocketCloseEvent()))
|
||||
this.ws.on('close', () =>
|
||||
resource.runInAsyncScope(() => this.bus.push(new WebSocketCloseEvent())))
|
||||
this.ws.on('error', () =>
|
||||
resource.runInAsyncScope(() => this.bus.push(new WebSocketCloseEvent())))
|
||||
|
||||
await this.registerHealthCheck()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user