Skip to content

Commit

Permalink
change log window from 1 day to 6 hours (#4346)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-g-town authored Feb 29, 2024
1 parent 396fd4c commit b62a37f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ export const useLogs = (
flushLogsBuffer(true);
const websocketKey = `${currentPod}-${namespace}-websocket`;
const endDate = dayjs(setDate);
const oneDayAgo = endDate.subtract(1, "day");
const sixHoursAgo = endDate.subtract(6, "hour");

const { logs: initialLogs, previousCursor, nextCursor } = await queryLogs(
oneDayAgo.toISOString(),
sixHoursAgo.toISOString(),
endDate.toISOString(),
Direction.backward
);
Expand Down Expand Up @@ -335,10 +335,10 @@ export const useLogs = (
// we query by setting the endDate equal to the previous startDate, and setting the direction
// to "backward"
const refDate = paginationInfo.previousCursor ?? dayjs().toISOString();
const oneDayAgo = dayjs(refDate).subtract(1, "day");
const sixHoursAgo = dayjs(refDate).subtract(6, "hour");

const { logs: newLogs, previousCursor } = await queryLogs(
oneDayAgo.toISOString(),
sixHoursAgo.toISOString(),
refDate,
Direction.backward
);
Expand Down

0 comments on commit b62a37f

Please sign in to comment.