weed mount add ttl option
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user