Skip to content

Commit

Permalink
Fix high cpu load when in crashloopbackoff state (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
joyrex2001 committed Oct 31, 2021
1 parent 26a3c6d commit 666ed5f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/backend/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ func (in *instance) GetLogs(tainr *types.Container, follow bool, count int, stop
// read log input (blocking read)
buf := make([]byte, 255)
n, err := stream.Read(buf)
if n == 0 {
if !follow {
break
}
continue
}
if err == io.EOF {
break
}
if err != nil {
return err
}
if n == 0 {
if !follow {
break
}
continue
}
// write log to output
if n, err = out.Write(buf[:n]); n == 0 || err != nil {
break
Expand Down

0 comments on commit 666ed5f

Please sign in to comment.