Skip to content

Commit

Permalink
Fix check docker connection
Browse files Browse the repository at this point in the history
  • Loading branch information
xetorthio committed Aug 11, 2017
1 parent fb1e50d commit 9866050
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions docker/local_cached_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,9 @@ func (f *localCachedFactory) check(c *client.Client) error {
for i := 0; i < 5; i++ {
_, err := c.Ping(context.Background())
if err != nil {
if client.IsErrConnectionFailed(err) {
// connection has failed, maybe instance is not ready yet, sleep and retry
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)
time.Sleep(time.Second)
continue
}
return 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)
time.Sleep(time.Second)
continue
}
ok = true
break
Expand Down

0 comments on commit 9866050

Please sign in to comment.