diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2021-04-06 13:39:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-06 13:39:26 +0800 |
| commit | 8693cdacae5b4201ccd259382a02392250b0890e (patch) | |
| tree | b565af4380b0f59a61b1d3c9fad8f04cbb802e7c /weed/shell/command_s3_clean_uploads.go | |
| parent | 17d02264f33f501e124060ade7b0b39e687aaa3d (diff) | |
| parent | a37eca78cd680858d021cd864766b0847328a8d7 (diff) | |
| download | seaweedfs-8693cdacae5b4201ccd259382a02392250b0890e.tar.xz seaweedfs-8693cdacae5b4201ccd259382a02392250b0890e.zip | |
Merge pull request #75 from chrislusf/master
sync
Diffstat (limited to 'weed/shell/command_s3_clean_uploads.go')
| -rw-r--r-- | weed/shell/command_s3_clean_uploads.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/shell/command_s3_clean_uploads.go b/weed/shell/command_s3_clean_uploads.go index 1fe13d981..5f674d7b6 100644 --- a/weed/shell/command_s3_clean_uploads.go +++ b/weed/shell/command_s3_clean_uploads.go @@ -54,7 +54,7 @@ func (c *commandS3CleanUploads) Do(args []string, commandEnv *CommandEnv, writer return fmt.Errorf("list buckets under %v: %v", filerBucketsPath, err) } - for _, bucket:= range buckets { + for _, bucket := range buckets { c.cleanupUploads(commandEnv, writer, filerBucketsPath, bucket, *uploadedTimeAgo) } @@ -63,7 +63,7 @@ func (c *commandS3CleanUploads) Do(args []string, commandEnv *CommandEnv, writer } func (c *commandS3CleanUploads) cleanupUploads(commandEnv *CommandEnv, writer io.Writer, filerBucketsPath string, bucket string, timeAgo time.Duration) error { - uploadsDir := filerBucketsPath+"/"+bucket+"/.uploads" + uploadsDir := filerBucketsPath + "/" + bucket + "/.uploads" var staleUploads []string now := time.Now() err := filer_pb.List(commandEnv, uploadsDir, "", func(entry *filer_pb.Entry, isLast bool) error { @@ -77,8 +77,8 @@ func (c *commandS3CleanUploads) cleanupUploads(commandEnv *CommandEnv, writer io return fmt.Errorf("list uploads under %v: %v", uploadsDir, err) } - for _, staleUpload:= range staleUploads { - deleteUrl := fmt.Sprintf("http://%s:%d%s/%s?recursive=true&ignoreRecursiveError=true",commandEnv.option.FilerHost, commandEnv.option.FilerPort,uploadsDir, staleUpload) + for _, staleUpload := range staleUploads { + deleteUrl := fmt.Sprintf("http://%s:%d%s/%s?recursive=true&ignoreRecursiveError=true", commandEnv.option.FilerHost, commandEnv.option.FilerPort, uploadsDir, staleUpload) fmt.Fprintf(writer, "purge %s\n", deleteUrl) err = util.Delete(deleteUrl, "") @@ -89,4 +89,4 @@ func (c *commandS3CleanUploads) cleanupUploads(commandEnv *CommandEnv, writer io return nil -}
\ No newline at end of file +} |
