Don't leak tickers in the exec probe

This commit is contained in:
Prashanth Balasubramanian
2015-07-05 17:03:10 -07:00
parent bb6f2f7ad9
commit 33e2f7cb8b
2 changed files with 6 additions and 4 deletions

View File

@@ -123,7 +123,8 @@ func (*NativeExecHandler) ExecInContainer(client DockerInterface, container *doc
if err != nil {
return err
}
tick := time.Tick(2 * time.Second)
ticker := time.NewTicker(2 * time.Second)
defer ticker.Stop()
count := 0
for {
inspect, err2 := client.InspectExec(execObj.ID)
@@ -143,7 +144,7 @@ func (*NativeExecHandler) ExecInContainer(client DockerInterface, container *doc
break
}
<-tick
<-ticker.C
}
return err