diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-06-11 23:13:33 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-06-11 23:13:33 -0700 |
| commit | 5bd72696ac1d602d67c5313e3a7b1848d290f712 (patch) | |
| tree | 13209e17bd989cfb90de00cad464ad7d7e47a669 /weed/command | |
| parent | 98110c16970a1c231a5cc04e0eb85ec48d649e14 (diff) | |
| download | seaweedfs-5bd72696ac1d602d67c5313e3a7b1848d290f712.tar.xz seaweedfs-5bd72696ac1d602d67c5313e3a7b1848d290f712.zip | |
weed mount add ttl option
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/mount.go | 2 | ||||
| -rw-r--r-- | weed/command/mount_std.go | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/weed/command/mount.go b/weed/command/mount.go index df215674f..a4ee03ac5 100644 --- a/weed/command/mount.go +++ b/weed/command/mount.go @@ -6,6 +6,7 @@ type MountOptions struct { dir *string collection *string replication *string + ttlSec *int chunkSizeLimitMB *int } @@ -20,6 +21,7 @@ func init() { mountOptions.dir = cmdMount.Flag.String("dir", ".", "mount weed filer to this directory") mountOptions.collection = cmdMount.Flag.String("collection", "", "collection to create the files") mountOptions.replication = cmdMount.Flag.String("replication", "000", "replication to create to files") + mountOptions.ttlSec = cmdMount.Flag.Int("ttl", 0, "file ttl in seconds") mountOptions.chunkSizeLimitMB = cmdMount.Flag.Int("chunkSizeLimitMB", 16, "local write buffer size, also chunk large files") } diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index f64dccb54..f2ec349bc 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -73,7 +73,8 @@ func runMount(cmd *Command, args []string) bool { filerAddress := fmt.Sprintf("%s:%d", hostnameAndPort[0], filerGrpcPort) err = fs.Serve(c, filesys.NewSeaweedFileSystem( - filerAddress, *mountOptions.collection, *mountOptions.replication, *mountOptions.chunkSizeLimitMB)) + filerAddress, *mountOptions.collection, *mountOptions.replication, int32(*mountOptions.ttlSec), + *mountOptions.chunkSizeLimitMB)) if err != nil { fuse.Unmount(*mountOptions.dir) } |
