mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-04 15:58:39 +00:00
Ensure that ticker does not leak
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
@@ -128,8 +128,10 @@ func (d *driver) Restore(c *execdriver.Command) error {
|
||||
c.Process = &os.Process{
|
||||
Pid: nspid,
|
||||
}
|
||||
ticker := time.NewTicker(500 * time.Millisecond)
|
||||
defer ticker.Stop()
|
||||
|
||||
for _ = range time.Tick(500 * time.Millisecond) {
|
||||
for _ = range ticker.C {
|
||||
if err := syscall.Kill(nspid, 0); err != nil {
|
||||
if strings.Contains(err.Error(), "no such process") {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user