[enh] don't repeatedly alert about a failed state
This commit is contained in:
@@ -47,7 +47,10 @@ export function watcherLoop(
|
||||
}
|
||||
// Wait before reconnecting
|
||||
const waitingDelay = reconnectionDelays[Math.min(reconnectionDelays.length - 1, i)]
|
||||
await onDisconnection(waitingDelay, watcher.error)
|
||||
if (watcher.stateChanged) {
|
||||
// Notify only if state changed since
|
||||
await onDisconnection(waitingDelay, watcher.error)
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, waitingDelay))
|
||||
i++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user