diff --git a/x-pack/plugins/task_manager/server/polling/observable_monitor.ts b/x-pack/plugins/task_manager/server/polling/observable_monitor.ts index e0c31f7014a6a..da48164cd5026 100644 --- a/x-pack/plugins/task_manager/server/polling/observable_monitor.ts +++ b/x-pack/plugins/task_manager/server/polling/observable_monitor.ts @@ -39,7 +39,7 @@ export function createObservableMonitor( 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