mirror of
https://github.com/minio/minio.git
synced 2026-11-13 14:44:19 +00:00
fix: move context timeout closer to network for Delete calls (#10897)
allowing for disconnects to be limited to the drive themselves instead of disconnecting all drives.
This commit is contained in:
1 parent
0784a0c33a
commit
17a5ff51ff
3 files changed
+15
-10
No files matched your search
@@ -323,7 +323,10 @@ func (client *storageRESTClient) DeleteVersion(ctx context.Context, volume, path
|
||||
return err
|
||||
}
|
||||
|
||||
respBody, err := client.call(ctx, storageRESTMethodDeleteVersion, values, &buffer, -1)
|
||||
tctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
defer cancel()
|
||||
|
||||
respBody, err := client.call(tctx, storageRESTMethodDeleteVersion, values, &buffer, -1)
|
||||
defer http.DrainBody(respBody)
|
||||
return err
|
||||
}
|
||||
@@ -503,7 +506,9 @@ func (client *storageRESTClient) Delete(ctx context.Context, volume string, path
|
||||
values.Set(storageRESTVolume, volume)
|
||||
values.Set(storageRESTFilePath, path)
|
||||
values.Set(storageRESTRecursive, strconv.FormatBool(recursive))
|
||||
respBody, err := client.call(ctx, storageRESTMethodDeleteFile, values, nil, -1)
|
||||
tctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
defer cancel()
|
||||
respBody, err := client.call(tctx, storageRESTMethodDeleteFile, values, nil, -1)
|
||||
defer http.DrainBody(respBody)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user