Fix check docker connection
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user