use cachingfs

This commit is contained in:
Barak Michener 2018-03-31 17:23:40 -07:00
parent 892908fcf5
commit 61b665af13
10 changed files with 1963 additions and 2 deletions

View file

@ -6,6 +6,7 @@ import (
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/fuse/nodefs"
"github.com/hanwen/go-fuse/fuse/pathfs"
"github.com/hanwen/go-fuse/unionfs"
"github.com/sirupsen/logrus"
)
@ -31,6 +32,7 @@ func NewWsFs(opts WsFsOpts, req chan RequestCallback, closer chan bool) *pathfs.
if opts.ReadOnly {
fs = pathfs.NewReadonlyFileSystem(fs)
}
fs = unionfs.NewCachingFileSystem(fs, 1*time.Second)
return pathfs.NewPathNodeFs(fs, nil)
}