diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-04-11 11:16:20 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-04-11 11:16:20 +0500 |
| commit | 2dfbe210e02adf05227d8782c32ebd8bc2b38437 (patch) | |
| tree | 79da0d0ce2cfb748ea6b51402f96fc51e4660892 /weed/shell/command_s3_clean_uploads.go | |
| parent | a87f57e47c9a39c7f431448ac1f99954a30151da (diff) | |
| download | seaweedfs-2dfbe210e02adf05227d8782c32ebd8bc2b38437.tar.xz seaweedfs-2dfbe210e02adf05227d8782c32ebd8bc2b38437.zip | |
avoid breaking loop in cleanupUploads if error is empty
Diffstat (limited to 'weed/shell/command_s3_clean_uploads.go')
| -rw-r--r-- | weed/shell/command_s3_clean_uploads.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/shell/command_s3_clean_uploads.go b/weed/shell/command_s3_clean_uploads.go index 4f893df7a..b7cf9e426 100644 --- a/weed/shell/command_s3_clean_uploads.go +++ b/weed/shell/command_s3_clean_uploads.go @@ -55,7 +55,9 @@ func (c *commandS3CleanUploads) Do(args []string, commandEnv *CommandEnv, writer } for _, bucket := range buckets { - c.cleanupUploads(commandEnv, writer, filerBucketsPath, bucket, *uploadedTimeAgo) + if err := c.cleanupUploads(commandEnv, writer, filerBucketsPath, bucket, *uploadedTimeAgo); err != nil { + fmt.Fprintf(writer, fmt.Sprintf("failed cleanup uploads for backet %s: %v", bucket, err)) + } } return err @@ -82,7 +84,7 @@ func (c *commandS3CleanUploads) cleanupUploads(commandEnv *CommandEnv, writer io fmt.Fprintf(writer, "purge %s\n", deleteUrl) err = util.Delete(deleteUrl, "") - if err != nil { + if err != nil && err.Error() != "" { return fmt.Errorf("purge %s/%s: %v", uploadsDir, staleUpload, err) } } |
