Skip to content

Commit f0cd97b

Browse files
committed
cleanup
1 parent 562c9d0 commit f0cd97b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

agent/server/snykbroker/supervisor.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,15 @@ func (b *Supervisor) scanLines(reader io.Reader, output chan string, refCount *s
271271
if err == nil {
272272
return
273273
}
274-
if err != nil {
275-
output <- fmt.Sprintf("Warning (non-fatal), failed to read from scanner to pipe output: %v", err)
274+
275+
if err == io.EOF {
276+
return
276277
}
277278

278-
// dump what we have in the buffer, then continue
279-
output <- string(buffer) + "...[END OF BUFFER]"
279+
output <- fmt.Sprintf("Warning (non-fatal), failed to read from scanner to pipe output: %v", err)
280+
281+
// dump what we have in the buffer, first 16K, then continue
282+
output <- string(buffer[0:16*1024]) + "...[END OF BUFFER]"
280283
}
281284

282285
}()

0 commit comments

Comments
 (0)