Skip to content

Commit 1b1676d

Browse files
committed
fix ring buffer panic
1 parent ada4bc0 commit 1b1676d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/buffer/buffer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ import (
2626
// The function uses a ring buffer to efficiently store only the last maxJobLogLines lines.
2727
// If the response contains more lines than maxJobLogLines, only the most recent lines are kept.
2828
func ProcessResponseAsRingBufferToEnd(httpResp *http.Response, maxJobLogLines int) (string, int, *http.Response, error) {
29+
if maxJobLogLines > 100000 {
30+
maxJobLogLines = 100000
31+
}
32+
2933
lines := make([]string, maxJobLogLines)
3034
validLines := make([]bool, maxJobLogLines)
3135
totalLines := 0

0 commit comments

Comments
 (0)