Prevent sending shadowing healthcheck on a closed connection
This commit is contained in:
parent
ad8020848f
commit
3456f5e097
1 changed files with 6 additions and 3 deletions
|
@ -447,6 +447,7 @@ export class WebSocketResourceWithShadowing implements IWebSocketResource {
|
||||||
this.main.close();
|
this.main.close();
|
||||||
if (this.shadowing) {
|
if (this.shadowing) {
|
||||||
this.shadowing.close();
|
this.shadowing.close();
|
||||||
|
this.shadowing = undefined;
|
||||||
} else {
|
} else {
|
||||||
this.shadowingConnection.abort();
|
this.shadowingConnection.abort();
|
||||||
}
|
}
|
||||||
|
@ -456,6 +457,7 @@ export class WebSocketResourceWithShadowing implements IWebSocketResource {
|
||||||
this.main.shutdown();
|
this.main.shutdown();
|
||||||
if (this.shadowing) {
|
if (this.shadowing) {
|
||||||
this.shadowing.shutdown();
|
this.shadowing.shutdown();
|
||||||
|
this.shadowing = undefined;
|
||||||
} else {
|
} else {
|
||||||
this.shadowingConnection.abort();
|
this.shadowingConnection.abort();
|
||||||
}
|
}
|
||||||
|
@ -482,11 +484,12 @@ export class WebSocketResourceWithShadowing implements IWebSocketResource {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async sendShadowRequest(): Promise<void> {
|
private async sendShadowRequest(): Promise<void> {
|
||||||
// it could be that we're still connecting libsignal websocket
|
// In the shadowing mode, it could be that we're either
|
||||||
// in which case we're skipping the check
|
// still connecting libsignal websocket or have already closed it.
|
||||||
|
// In those cases we're not running shadowing check.
|
||||||
if (!this.shadowing) {
|
if (!this.shadowing) {
|
||||||
log.info(
|
log.info(
|
||||||
`${this.logId}: skipping healthcheck - websocket not connected yet`
|
`${this.logId}: skipping healthcheck - websocket not connected or already closed`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue