Skip to content

Commit

Permalink
Although get a EOF error, we should still know it
Browse files Browse the repository at this point in the history
  • Loading branch information
boxjan committed Apr 9, 2021
1 parent fa9ef78 commit 8449c1e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pkg/s3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,8 @@ func (client *s3Client) removeObjects(bucketName, prefix string) error {
errorCh := client.minio.RemoveObjects(client.ctx, bucketName, objectsCh, opts)
haveErrWhenRemoveObjects := false
for e := range errorCh {
if e.Err.Error() != "EOF" {
glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
haveErrWhenRemoveObjects = true
}
glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
haveErrWhenRemoveObjects = true
}
if haveErrWhenRemoveObjects {
return fmt.Errorf("Failed to remove all objects of bucket %s", bucketName)
Expand Down Expand Up @@ -212,10 +210,8 @@ func (client *s3Client) removeObjectsOneByOne(bucketName, prefix string) error {

haveErrWhenRemoveObjects := false
for e := range removeErrCh {
if e.Err.Error() != "EOF" {
glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
haveErrWhenRemoveObjects = true
}
glog.Errorf("Failed to remove object %s, error: %s", e.ObjectName, e.Err)
haveErrWhenRemoveObjects = true
}
if haveErrWhenRemoveObjects {
return fmt.Errorf("Failed to remove all objects of path %s", bucketName)
Expand Down

0 comments on commit 8449c1e

Please sign in to comment.