Skip to content

Commit

Permalink
more and faster ws reorder retries
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Dec 30, 2024
1 parent 6f4fc36 commit e99e64a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/common/src/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class WsSocket {
pubsub.emit('socket.lag', this.averageLag);
};

private handle = (m: MsgIn, retries: number = 5): void => {
private handle = (m: MsgIn, retries: number = 10): void => {
if (m.v && this.version !== false) {
if (m.v <= this.version) {
this.debug('already has event ' + m.v);
Expand All @@ -277,7 +277,7 @@ class WsSocket {
if (m.v > this.version + 1) {
if (retries > 0) {
console.debug('version gap, retrying', m.v, this.version, retries);
setTimeout(() => this.handle(m, retries - 1), 500);
setTimeout(() => this.handle(m, retries - 1), 200);
} else {
console.log('version gap, reloading');
site.reload();
Expand Down

0 comments on commit e99e64a

Please sign in to comment.