Skip to content

Commit

Permalink
fix: live tail time out is updated (#1899)
Browse files Browse the repository at this point in the history
* fix: live tail time out is updated
* Update livetail.ts

Co-authored-by: Pranay Prateek <pranay@signoz.io>
Co-authored-by: Ankit Nayan <ankit@signoz.io>
  • Loading branch information
3 people authored Dec 27, 2022
1 parent eef48c5 commit 13a6d7f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions frontend/src/api/logs/livetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
);
};

0 comments on commit 13a6d7f

Please sign in to comment.