Przeglądaj źródła

Merge pull request #206 from thaJeztah/19.03_backport_no_retry_ping_on_errconn

[19.03 backport] client: do not fallback to GET if HEAD on _ping fail to connect
Sebastiaan van Stijn 6 lat temu
rodzic
commit
7cc3681ad6
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      client/ping.go

+ 2 - 0
client/ping.go

@@ -31,6 +31,8 @@ func (cli *Client) Ping(ctx context.Context) (types.Ping, error) {
 			// Server handled the request, so parse the response
 			return parsePingResponse(cli, serverResp)
 		}
+	} else if IsErrConnectionFailed(err) {
+		return ping, err
 	}
 
 	req, err = cli.buildRequest("GET", path.Join(cli.basePath, "/_ping"), nil, nil)