diff --git a/frontend/src/api/logs/livetail.ts b/frontend/src/api/logs/livetail.ts index f1cec5472a..150f63d193 100644 --- a/frontend/src/api/logs/livetail.ts +++ b/frontend/src/api/logs/livetail.ts @@ -4,14 +4,16 @@ import { ENVIRONMENT } from 'constants/env'; import { LOCALSTORAGE } from 'constants/localStorage'; import { EventSourcePolyfill } from 'event-source-polyfill'; -export const LiveTail = (queryParams: string): EventSourcePolyfill => { - const dict = { - headers: { - Authorization: `Bearer ${getLocalStorageKey(LOCALSTORAGE.AUTH_TOKEN)}`, - }, - }; - return new EventSourcePolyfill( +// 10 min in ms +const TIMEOUT_IN_MS = 10 * 60 * 1000; + +export const LiveTail = (queryParams: string): EventSourcePolyfill => + new EventSourcePolyfill( `${ENVIRONMENT.baseURL}${apiV1}logs/tail?${queryParams}`, - dict, + { + headers: { + Authorization: `Bearer ${getLocalStorageKey(LOCALSTORAGE.AUTH_TOKEN)}`, + }, + heartbeatTimeout: TIMEOUT_IN_MS, + }, ); -};