added custom buffer size error handling
This commit is contained in:
parent
28232d976b
commit
711f020c18
4 changed files with 123 additions and 10 deletions
|
|
@ -30,6 +30,7 @@ var (
|
|||
listenCache string
|
||||
quota int64
|
||||
max int
|
||||
bs int
|
||||
|
||||
log logr.Logger
|
||||
)
|
||||
|
|
@ -45,12 +46,17 @@ func main() {
|
|||
flag.StringVar(&listenWebdav, "webdav", "", "listen addr:port for webdav")
|
||||
flag.StringVar(&listenCache, "cache", "", "listen addr:port for cache only")
|
||||
flag.IntVar(&max, "max", -1, "max parallel preloads")
|
||||
flag.IntVar(&bs, "bs", -1, "tune reload buffer size in bytes (default: 8192)")
|
||||
flag.Int64Var("a, "quota", 1, "max disk usage quota in GiB")
|
||||
flag.Parse()
|
||||
|
||||
log = klogr.New().WithName("main")
|
||||
log.Info("starting cachefs", "version", version)
|
||||
|
||||
if fs.SetBufferSize(bs) {
|
||||
log.V(2).Info("changed preload buffer size", "size", bs)
|
||||
}
|
||||
|
||||
filesystem, err := fs.NewFS(quota*gib, max, src, dst, metadata, klogr.New().WithName("fs"))
|
||||
if err != nil {
|
||||
klog.Fatalf("init failed: %s", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue