mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
spread out reconnects between 2 and 5 min
This commit is contained in:
@@ -179,7 +179,7 @@ export class NotificationsService implements NotificationsServiceAbstraction {
|
|||||||
} catch { }
|
} catch { }
|
||||||
|
|
||||||
if (!this.connected) {
|
if (!this.connected) {
|
||||||
this.reconnectTimer = setTimeout(() => this.reconnect(sync), 120000);
|
this.reconnectTimer = setTimeout(() => this.reconnect(sync), this.random(120000, 300000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,4 +189,10 @@ export class NotificationsService implements NotificationsServiceAbstraction {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private random(min: number, max: number) {
|
||||||
|
min = Math.ceil(min);
|
||||||
|
max = Math.floor(max);
|
||||||
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user