From 7d7acd37a622d120362a639d70c0cdf697bcaa6a Mon Sep 17 00:00:00 2001 From: Palash Gupta Date: Thu, 22 Dec 2022 14:50:04 +0530 Subject: [PATCH 1/3] fix: live tail time out is updated --- frontend/src/api/logs/livetail.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/frontend/src/api/logs/livetail.ts b/frontend/src/api/logs/livetail.ts index f1cec5472ae..9632a5d48c5 100644 --- a/frontend/src/api/logs/livetail.ts +++ b/frontend/src/api/logs/livetail.ts @@ -4,14 +4,15 @@ 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( +const TIMEOUT_IN_MS = 120000; + +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, + }, ); -}; From d2559505fd6a7207da3710fe4fdac4e723924515 Mon Sep 17 00:00:00 2001 From: Palash Gupta Date: Thu, 22 Dec 2022 16:00:01 +0530 Subject: [PATCH 2/3] chore: time out is updated --- frontend/src/api/logs/livetail.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/api/logs/livetail.ts b/frontend/src/api/logs/livetail.ts index 9632a5d48c5..bb0e533cc5f 100644 --- a/frontend/src/api/logs/livetail.ts +++ b/frontend/src/api/logs/livetail.ts @@ -4,7 +4,8 @@ import { ENVIRONMENT } from 'constants/env'; import { LOCALSTORAGE } from 'constants/localStorage'; import { EventSourcePolyfill } from 'event-source-polyfill'; -const TIMEOUT_IN_MS = 120000; +// 10 min in ms +const TIMEOUT_IN_MS = 10 * 10 * 1000; export const LiveTail = (queryParams: string): EventSourcePolyfill => new EventSourcePolyfill( From 5dab31ba980a200f29921daf32eb20d34776f200 Mon Sep 17 00:00:00 2001 From: Palash Gupta Date: Mon, 26 Dec 2022 16:36:59 +0530 Subject: [PATCH 3/3] Update livetail.ts --- frontend/src/api/logs/livetail.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/api/logs/livetail.ts b/frontend/src/api/logs/livetail.ts index bb0e533cc5f..150f63d193e 100644 --- a/frontend/src/api/logs/livetail.ts +++ b/frontend/src/api/logs/livetail.ts @@ -5,7 +5,7 @@ import { LOCALSTORAGE } from 'constants/localStorage'; import { EventSourcePolyfill } from 'event-source-polyfill'; // 10 min in ms -const TIMEOUT_IN_MS = 10 * 10 * 1000; +const TIMEOUT_IN_MS = 10 * 60 * 1000; export const LiveTail = (queryParams: string): EventSourcePolyfill => new EventSourcePolyfill(