diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2025-11-05 18:14:55 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2025-11-05 18:14:55 +0500 |
| commit | 20fb1ead7712fae8e91a434d93c21588a6645b72 (patch) | |
| tree | 878b0c3fdb7ce7f9969e03fc09c8ef090c71edb7 /weed/s3api/filer_util.go | |
| parent | a88eab0b9719540116fb0bca38900e7fe7d36fd9 (diff) | |
| download | seaweedfs-20fb1ead7712fae8e91a434d93c21588a6645b72.tar.xz seaweedfs-20fb1ead7712fae8e91a434d93c21588a6645b72.zip | |
fix updateTTL
Diffstat (limited to 'weed/s3api/filer_util.go')
| -rw-r--r-- | weed/s3api/filer_util.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/s3api/filer_util.go b/weed/s3api/filer_util.go index e02b945cd..6cc40f25e 100644 --- a/weed/s3api/filer_util.go +++ b/weed/s3api/filer_util.go @@ -3,6 +3,7 @@ package s3api import ( "context" "fmt" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" "math" "strings" @@ -114,11 +115,12 @@ func (s3a *S3ApiServer) updateEntriesTTL(parentDirectoryPath string, ttlSec int3 ctx := context.Background() err := filer_pb.SeaweedList(ctx, client, parentDirectoryPath, "", func(entry *filer_pb.Entry, isLast bool) error { if entry.IsDirectory { - return s3a.updateEntriesTTL(fmt.Sprintf("%s/%s", parentDirectoryPath, entry.Name), ttlSec) + return s3a.updateEntriesTTL(fmt.Sprintf("%s/%s", strings.TrimRight(parentDirectoryPath, "/"), entry.Name), ttlSec) } if entry.Attributes == nil { entry.Attributes = &filer_pb.FuseAttributes{} } + entry.Extended[s3_constants.SeaweedFSExpiresS3] = []byte("true") if entry.Attributes.TtlSec == ttlSec { return nil } |
