Skip to content

Commit

Permalink
Fix negative offset of reconnect delay (#8718)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-at-t authored Jan 23, 2025
1 parent 2ec1c76 commit c20267b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/database/src/core/PersistentConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,10 @@ export class PersistentConnection extends ServerActions {
this.lastConnectionEstablishedTime_ = null;
}

const timeSinceLastConnectAttempt =
new Date().getTime() - this.lastConnectionAttemptTime_;
const timeSinceLastConnectAttempt = Math.max(
0,
new Date().getTime() - this.lastConnectionAttemptTime_
);
let reconnectDelay = Math.max(
0,
this.reconnectDelay_ - timeSinceLastConnectAttempt
Expand Down

0 comments on commit c20267b

Please sign in to comment.