1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #29747 from xlgao-zju/break-the-for

exit collect when we get EOF
This commit is contained in:
Vincent Demeester 2017-02-01 22:29:18 +01:00 committed by GitHub
commit 3c64061b67

View file

@ -152,11 +152,13 @@ func collect(ctx context.Context, s *formatter.ContainerStats, cli client.APICli
waitFirst.Done()
}
case err := <-u:
s.SetError(err)
if err == io.EOF {
break
}
if err != nil {
s.SetError(err)
continue
}
s.SetError(nil)
// if this is the first stat you get, release WaitGroup
if !getFirst {
getFirst = true