remove context deadline from Delete calls (#10901)

master
Harshavardhana 4 years ago committed by GitHub
parent 0745736e28
commit 80b8ce89a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      cmd/storage-rest-client.go

@ -323,10 +323,7 @@ func (client *storageRESTClient) DeleteVersion(ctx context.Context, volume, path
return err return err
} }
tctx, cancel := context.WithTimeout(ctx, 5*time.Second) respBody, err := client.call(ctx, storageRESTMethodDeleteVersion, values, &buffer, -1)
defer cancel()
respBody, err := client.call(tctx, storageRESTMethodDeleteVersion, values, &buffer, -1)
defer http.DrainBody(respBody) defer http.DrainBody(respBody)
return err return err
} }
@ -506,9 +503,8 @@ func (client *storageRESTClient) Delete(ctx context.Context, volume string, path
values.Set(storageRESTVolume, volume) values.Set(storageRESTVolume, volume)
values.Set(storageRESTFilePath, path) values.Set(storageRESTFilePath, path)
values.Set(storageRESTRecursive, strconv.FormatBool(recursive)) values.Set(storageRESTRecursive, strconv.FormatBool(recursive))
tctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel() respBody, err := client.call(ctx, storageRESTMethodDeleteFile, values, nil, -1)
respBody, err := client.call(tctx, storageRESTMethodDeleteFile, values, nil, -1)
defer http.DrainBody(respBody) defer http.DrainBody(respBody)
return err return err
} }

Loading…
Cancel
Save