Fix timer

This commit is contained in:
Mike Cote 2020-09-29 09:50:44 -04:00
parent c497979f3e
commit 0817e5e6a5

View file

@ -39,7 +39,7 @@ export function createObservableMonitor<T, E>(
return new Observable((subscriber) => {
const subscription: Subscription = interval(heartbeatInterval)
.pipe(
startWith(0),
startWith(timer(0, heartbeatInterval)),
// switch from the heartbeat interval to the instantiated observable until it completes / errors
exhaustMap(() => takeUntilDurationOfInactivity(observableFactory(), inactivityTimeout)),
// if an error is thrown, catch it, notify and try to recover