diff --git a/cmd/lock-rest-client.go b/cmd/lock-rest-client.go index ca3ed977a..c3eecc5f4 100644 --- a/cmd/lock-rest-client.go +++ b/cmd/lock-rest-client.go @@ -161,7 +161,7 @@ func newlockRESTClient(endpoint Endpoint) *lockRESTClient { healthClient := rest.NewClient(serverURL, globalInternodeTransport, newAuthToken) healthClient.ExpectTimeouts = true restClient.HealthCheckFn = func() bool { - ctx, cancel := context.WithTimeout(GlobalContext, restClient.HealthCheckTimeout) + ctx, cancel := context.WithTimeout(context.Background(), restClient.HealthCheckTimeout) defer cancel() respBody, err := healthClient.Call(ctx, lockRESTMethodHealth, nil, nil, -1) xhttp.DrainBody(respBody) diff --git a/cmd/peer-rest-client.go b/cmd/peer-rest-client.go index 0cd35e107..fdb836052 100644 --- a/cmd/peer-rest-client.go +++ b/cmd/peer-rest-client.go @@ -881,7 +881,7 @@ func newPeerRESTClient(peer *xnet.Host) *peerRESTClient { // Construct a new health function. restClient.HealthCheckFn = func() bool { - ctx, cancel := context.WithTimeout(GlobalContext, restClient.HealthCheckTimeout) + ctx, cancel := context.WithTimeout(context.Background(), restClient.HealthCheckTimeout) defer cancel() respBody, err := healthClient.Call(ctx, peerRESTMethodHealth, nil, nil, -1) xhttp.DrainBody(respBody) diff --git a/cmd/storage-rest-client.go b/cmd/storage-rest-client.go index a78ebc0b8..2417507de 100644 --- a/cmd/storage-rest-client.go +++ b/cmd/storage-rest-client.go @@ -662,7 +662,7 @@ func newStorageRESTClient(endpoint Endpoint, healthcheck bool) *storageRESTClien healthClient := rest.NewClient(serverURL, globalInternodeTransport, newAuthToken) healthClient.ExpectTimeouts = true restClient.HealthCheckFn = func() bool { - ctx, cancel := context.WithTimeout(GlobalContext, restClient.HealthCheckTimeout) + ctx, cancel := context.WithTimeout(context.Background(), restClient.HealthCheckTimeout) defer cancel() respBody, err := healthClient.Call(ctx, storageRESTMethodHealth, nil, nil, -1) xhttp.DrainBody(respBody)