aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/filer_util.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/s3api/filer_util.go')
-rw-r--r--weed/s3api/filer_util.go4
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
}