Although get a EOF error, we should still know it
This commit is contained in:
parent
fa9ef78362
commit
8449c1e2e9
1 changed files with 4 additions and 8 deletions
|
@ -157,11 +157,9 @@ func (client *s3Client) removeObjects(bucketName, prefix string) error {
|
||||||
errorCh := client.minio.RemoveObjects(client.ctx, bucketName, objectsCh, opts)
|
errorCh := client.minio.RemoveObjects(client.ctx, bucketName, objectsCh, opts)
|
||||||
haveErrWhenRemoveObjects := false
|
haveErrWhenRemoveObjects := false
|
||||||
for e := range errorCh {
|
for e := range errorCh {
|
||||||
if e.Err.Error() != "EOF" {
|
|
||||||
glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
|
glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
|
||||||
haveErrWhenRemoveObjects = true
|
haveErrWhenRemoveObjects = true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if haveErrWhenRemoveObjects {
|
if haveErrWhenRemoveObjects {
|
||||||
return fmt.Errorf("Failed to remove all objects of bucket %s", bucketName)
|
return fmt.Errorf("Failed to remove all objects of bucket %s", bucketName)
|
||||||
}
|
}
|
||||||
|
@ -212,11 +210,9 @@ func (client *s3Client) removeObjectsOneByOne(bucketName, prefix string) error {
|
||||||
|
|
||||||
haveErrWhenRemoveObjects := false
|
haveErrWhenRemoveObjects := false
|
||||||
for e := range removeErrCh {
|
for e := range removeErrCh {
|
||||||
if e.Err.Error() != "EOF" {
|
|
||||||
glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
|
glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
|
||||||
haveErrWhenRemoveObjects = true
|
haveErrWhenRemoveObjects = true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if haveErrWhenRemoveObjects {
|
if haveErrWhenRemoveObjects {
|
||||||
return fmt.Errorf("Failed to remove all objects of path %s", bucketName)
|
return fmt.Errorf("Failed to remove all objects of path %s", bucketName)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue