aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_s3_clean_uploads.go
diff options
context:
space:
mode:
authorSmsS4 <36403983+SmsS4@users.noreply.github.com>2023-08-19 17:00:18 +0330
committerGitHub <noreply@github.com>2023-08-19 06:30:18 -0700
commit1e72579ac7d9dfb4968e8025cd8c715feeecbb5e (patch)
tree8f6697076528f8ae9381cde9611aa4beaf2b85d1 /weed/shell/command_s3_clean_uploads.go
parent710e88f71331d10299054db7ec34aa82e9198bb9 (diff)
downloadseaweedfs-1e72579ac7d9dfb4968e8025cd8c715feeecbb5e.tar.xz
seaweedfs-1e72579ac7d9dfb4968e8025cd8c715feeecbb5e.zip
Fix s3.clean.uploads (#4766)
Diffstat (limited to 'weed/shell/command_s3_clean_uploads.go')
-rw-r--r--weed/shell/command_s3_clean_uploads.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/weed/shell/command_s3_clean_uploads.go b/weed/shell/command_s3_clean_uploads.go
index 81af4bbb7..2be61f72a 100644
--- a/weed/shell/command_s3_clean_uploads.go
+++ b/weed/shell/command_s3_clean_uploads.go
@@ -3,13 +3,14 @@ package shell
import (
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
- "github.com/seaweedfs/seaweedfs/weed/security"
- "github.com/seaweedfs/seaweedfs/weed/util"
"io"
"math"
"time"
+ "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
+ "github.com/seaweedfs/seaweedfs/weed/security"
+ "github.com/seaweedfs/seaweedfs/weed/util"
+
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
@@ -17,8 +18,7 @@ func init() {
Commands = append(Commands, &commandS3CleanUploads{})
}
-type commandS3CleanUploads struct {
-}
+type commandS3CleanUploads struct{}
func (c *commandS3CleanUploads) Name() string {
return "s3.clean.uploads"
@@ -34,14 +34,13 @@ func (c *commandS3CleanUploads) Help() string {
}
func (c *commandS3CleanUploads) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
-
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
uploadedTimeAgo := bucketCommand.Duration("timeAgo", 24*time.Hour, "created time before now. \"1.5h\" or \"2h45m\". Valid time units are \"m\", \"h\"")
if err = bucketCommand.Parse(args); err != nil {
return nil
}
- signingKey := util.GetViper().GetString("jwt.signing.key")
+ signingKey := util.GetViper().GetString("jwt.filer_signing.key")
var filerBucketsPath string
filerBucketsPath, err = readFilerBucketsPath(commandEnv)
@@ -65,7 +64,6 @@ func (c *commandS3CleanUploads) Do(args []string, commandEnv *CommandEnv, writer
}
return err
-
}
func (c *commandS3CleanUploads) cleanupUploads(commandEnv *CommandEnv, writer io.Writer, filerBucketsPath string, bucket string, timeAgo time.Duration, signingKey string) error {
@@ -99,5 +97,4 @@ func (c *commandS3CleanUploads) cleanupUploads(commandEnv *CommandEnv, writer io
}
return nil
-
}