[mod] have a unique value of reconnection delay
This commit is contained in:
@@ -4,7 +4,7 @@ export function watcherLoop(
|
||||
name: string,
|
||||
connect: () => Promise<void>,
|
||||
onConnectionClosed: () => Promise<void>,
|
||||
reconnectionDelays: number[],
|
||||
waitingDelay: number,
|
||||
onStart: () => Promise<void>,
|
||||
onDisconnection: (waitingDelay: number, error: any) => Promise<void>,
|
||||
onRestart: () => Promise<void>,
|
||||
@@ -46,7 +46,6 @@ export function watcherLoop(
|
||||
watcher.stateFailure(e)
|
||||
}
|
||||
// Wait before reconnecting
|
||||
const waitingDelay = reconnectionDelays[Math.min(reconnectionDelays.length - 1, i)]
|
||||
if (watcher.stateChanged) {
|
||||
// Notify only if state changed since
|
||||
await onDisconnection(waitingDelay, watcher.error)
|
||||
|
||||
Reference in New Issue
Block a user