Skip to content

Commit d101260

Browse files
authored
Double the amount of fetched logs with every click on fetch more (#1034)
1 parent 6143c97 commit d101260

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLogCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { classNames } from "../../../common/utils/classnames.ts";
1515
import { linkifyJsOptions } from "../../../common/utils/linkify-js.ts";
1616
import LiveTotal from "../../../common/utils/live-total.tsx";
1717
import {
18-
LOG_FETCH_SIZE,
1918
StepInfo,
2019
StepLogBufferInfo,
2120
TAIL_CONSOLE_LOG,
@@ -171,8 +170,9 @@ function ConsoleLogBody({
171170
};
172171

173172
const showMoreLogs = () => {
174-
let startByte = stepBuffer.startByte - LOG_FETCH_SIZE;
175-
if (startByte < 0) startByte = 0;
173+
// Double the amount of fetched logs with every click.
174+
const alreadyFetched = stepBuffer.endByte - stepBuffer.startByte;
175+
const startByte = Math.max(0, stepBuffer.startByte - alreadyFetched);
176176
onMoreConsoleClick(step.id, startByte);
177177
};
178178

0 commit comments

Comments
 (0)