aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-06-05 23:29:25 -0700
committerchrislu <chris.lu@gmail.com>2023-06-05 23:29:25 -0700
commit0bffb3770f4096cd8b0eb1be397a9e1372aaeea0 (patch)
tree34c6a03d22c1601f04f4d674f5d564be77a66e33 /weed
parentabef448c518249d0e3b8042fc6ce8059e7004e5f (diff)
downloadseaweedfs-0bffb3770f4096cd8b0eb1be397a9e1372aaeea0.tar.xz
seaweedfs-0bffb3770f4096cd8b0eb1be397a9e1372aaeea0.zip
support TTL when creating folders
related to https://github.com/seaweedfs/seaweedfs/discussions/4549
Diffstat (limited to 'weed')
-rw-r--r--weed/server/filer_server_handlers_write_autochunk.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go
index 27519bee7..8488aa3c6 100644
--- a/weed/server/filer_server_handlers_write_autochunk.go
+++ b/weed/server/filer_server_handlers_write_autochunk.go
@@ -40,7 +40,7 @@ func (fs *FilerServer) autoChunk(ctx context.Context, w http.ResponseWriter, r *
var md5bytes []byte
if r.Method == "POST" {
if r.Header.Get("Content-Type") == "" && strings.HasSuffix(r.URL.Path, "/") {
- reply, err = fs.mkdir(ctx, w, r)
+ reply, err = fs.mkdir(ctx, w, r, so)
} else {
reply, md5bytes, err = fs.doPostAutoChunk(ctx, w, r, chunkSize, contentLength, so)
}
@@ -303,7 +303,7 @@ func (fs *FilerServer) saveAsChunk(so *operation.StorageOption) filer.SaveDataAs
}
}
-func (fs *FilerServer) mkdir(ctx context.Context, w http.ResponseWriter, r *http.Request) (filerResult *FilerPostResult, replyerr error) {
+func (fs *FilerServer) mkdir(ctx context.Context, w http.ResponseWriter, r *http.Request, so *operation.StorageOption) (filerResult *FilerPostResult, replyerr error) {
// detect file mode
modeStr := r.URL.Query().Get("mode")
@@ -337,6 +337,7 @@ func (fs *FilerServer) mkdir(ctx context.Context, w http.ResponseWriter, r *http
Mode: os.FileMode(mode) | os.ModeDir,
Uid: OS_UID,
Gid: OS_GID,
+ TtlSec: so.TtlSeconds,
},
}