Fix check docker connection

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-08-11 19:01:52 -03:00
parent fb1e50deaf
commit 986605015e

View File

@@ -118,13 +118,9 @@ func (f *localCachedFactory) check(c *client.Client) error {
for i := 0; i < 5; i++ { for i := 0; i < 5; i++ {
_, err := c.Ping(context.Background()) _, err := c.Ping(context.Background())
if err != nil { if err != nil {
if client.IsErrConnectionFailed(err) { log.Printf("Connection to [%s] has failed, maybe instance is not ready yet, sleeping and retrying in 1 second. Try #%d\n", c.DaemonHost(), i+1)
// connection has failed, maybe instance is not ready yet, sleep and retry time.Sleep(time.Second)
log.Printf("Connection to [%s] has failed, maybe instance is not ready yet, sleeping and retrying in 1 second. Try #%d\n", c.DaemonHost(), i+1) continue
time.Sleep(time.Second)
continue
}
return err
} }
ok = true ok = true
break break