Remove unusued params and functions (#8399)

This commit is contained in:
Harshavardhana
2019-10-15 18:35:41 -07:00
committed by GitHub
parent b7ee0bbbc9
commit d48fd6fde9
33 changed files with 64 additions and 164 deletions
+4 -9
View File
@@ -47,9 +47,8 @@ type peerRESTClient struct {
}
// Reconnect to a peer rest server.
func (client *peerRESTClient) reConnect() error {
func (client *peerRESTClient) reConnect() {
atomic.StoreInt32(&client.connected, 1)
return nil
}
// Wrapper to restClient.Call to handle network errors, in case of network error the connection is marked disconnected
@@ -64,11 +63,7 @@ func (client *peerRESTClient) call(method string, values url.Values, body io.Rea
// after verifying format.json
func (client *peerRESTClient) callWithContext(ctx context.Context, method string, values url.Values, body io.Reader, length int64) (respBody io.ReadCloser, err error) {
if !client.IsOnline() {
err := client.reConnect()
logger.LogIf(ctx, err)
if err != nil {
return nil, err
}
client.reConnect()
}
if values == nil {
@@ -694,7 +689,7 @@ func getRemoteHosts(endpoints EndpointList) []*xnet.Host {
return remoteHosts
}
func getRestClients(peerHosts []*xnet.Host) ([]*peerRESTClient, error) {
func getRestClients(peerHosts []*xnet.Host) []*peerRESTClient {
restClients := make([]*peerRESTClient, len(peerHosts))
for i, host := range peerHosts {
client, err := newPeerRESTClient(host)
@@ -704,7 +699,7 @@ func getRestClients(peerHosts []*xnet.Host) ([]*peerRESTClient, error) {
restClients[i] = client
}
return restClients, nil
return restClients
}
// Returns a peer rest client.