Skip to content

Commit 8bd19fa

Browse files
committed
fix(cubestore-driver): Increase retry timeout to avoid endless loop connection retries
1 parent 1feb327 commit 8bd19fa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/cubejs-cubestore-driver/src/WebSocketConnection.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ export class WebSocketConnection {
7171
}
7272
});
7373
webSocket.on('pong', () => {
74-
this.currentConnectionTry = 0;
74+
if (webSocket === this.webSocket) {
75+
this.currentConnectionTry = 0;
76+
}
7577
webSocket.lastHeartBeat = new Date();
7678
});
7779
webSocket.on('close', () => {
@@ -155,7 +157,7 @@ export class WebSocketConnection {
155157
}
156158

157159
private retryWaitTime() {
158-
return 1000 * this.currentConnectionTry;
160+
return 1000 * (this.currentConnectionTry + 1);
159161
}
160162

161163
private async sendMessage(messageId: number, buffer: Uint8Array): Promise<any> {

0 commit comments

Comments
 (0)