From 1b1676d2b0d66ca52cc3960618035b9739bc229f Mon Sep 17 00:00:00 2001 From: Matt Holloway Date: Mon, 8 Dec 2025 10:42:06 +0000 Subject: [PATCH] fix ring buffer panic --- pkg/buffer/buffer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/buffer/buffer.go b/pkg/buffer/buffer.go index 546b5324c..14bcf9582 100644 --- a/pkg/buffer/buffer.go +++ b/pkg/buffer/buffer.go @@ -26,6 +26,10 @@ import ( // The function uses a ring buffer to efficiently store only the last maxJobLogLines lines. // If the response contains more lines than maxJobLogLines, only the most recent lines are kept. func ProcessResponseAsRingBufferToEnd(httpResp *http.Response, maxJobLogLines int) (string, int, *http.Response, error) { + if maxJobLogLines > 100000 { + maxJobLogLines = 100000 + } + lines := make([]string, maxJobLogLines) validLines := make([]bool, maxJobLogLines) totalLines := 0