mirror of
https://github.com/minio/minio.git
synced 2025-04-08 13:45:37 -04:00
Return if paths are empty in DeleteFileBulk (#8085)
This avoids a network call, also fixes an issue when empty paths are passed the underlying call fails with "405 Method Not Allowed". This is reproducible when you are deleting a non-existent object. Fixes #8083
This commit is contained in:
parent
825e29f301
commit
6e7962bf35
@ -374,6 +374,9 @@ func (client *storageRESTClient) DeleteFile(volume, path string) error {
|
|||||||
|
|
||||||
// DeleteFileBulk - deletes files in bulk.
|
// DeleteFileBulk - deletes files in bulk.
|
||||||
func (client *storageRESTClient) DeleteFileBulk(volume string, paths []string) (errs []error, err error) {
|
func (client *storageRESTClient) DeleteFileBulk(volume string, paths []string) (errs []error, err error) {
|
||||||
|
if len(paths) == 0 {
|
||||||
|
return errs, err
|
||||||
|
}
|
||||||
errs = make([]error, len(paths))
|
errs = make([]error, len(paths))
|
||||||
values := make(url.Values)
|
values := make(url.Values)
|
||||||
values.Set(storageRESTVolume, volume)
|
values.Set(storageRESTVolume, volume)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user