Skip to content

Commit

Permalink
Catch when stats channel is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtempleton committed Jun 7, 2016
1 parent d56f86c commit 9cf99a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/docker/stats_handling.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ func (m *StatsManager) statsAttach(id string, client DockerClient) error {
})

// Once it has exited, close our pipes
close(statsrd)
close(done)
if err != nil {
failure <- err
Expand Down Expand Up @@ -325,7 +324,10 @@ func NewStatsPump(statsChan chan *docker.Stats, name string, fields map[string]s
// from the channel
pump := func(sourceChan chan *docker.Stats, fields map[string]string) {
for {
source := <-sourceChan
source, ok := <-sourceChan
if !ok{
return
}
json_ver, _ := json.Marshal(source)
// Send a DockerStat struct out
obj.send(&DockerStat{
Expand Down

0 comments on commit 9cf99a1

Please sign in to comment.