From 0817e5e6a5ef9bdfe9329a559f4a5674ebbbef24 Mon Sep 17 00:00:00 2001 From: Mike Cote Date: Tue, 29 Sep 2020 09:50:44 -0400 Subject: [PATCH] Fix timer --- .../plugins/task_manager/server/polling/observable_monitor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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