Skip to content

Commit

Permalink
Merge pull request #6 from chai2010/dev-refine-metad-backend
Browse files Browse the repository at this point in the history
backend/metad: donot log when testConnection success
  • Loading branch information
Martin@qingcloud authored Jan 15, 2018
2 parents d1f3efa + bfe639d commit a4a7158
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions backends/metad/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ func (c *Connection) testConnection() error {
maxTime := 15 * time.Second

for i := 1 * time.Second; i < maxTime; i *= time.Duration(2) {
if _, err = c.makeMetaDataRequest("/"); err != nil {
time.Sleep(i)
} else {
log.Error("failed to connect to %s, please check your network connection.", c.url)
return nil
if _, err = c.makeMetaDataRequest("/"); err == nil {
return nil // OK
}

time.Sleep(i)
}
return err
}
Expand Down

0 comments on commit a4a7158

Please sign in to comment.