background scanner

This commit is contained in:
royalcat 2024-12-09 23:46:15 +03:00
parent 94ca4cf599
commit 36c501347c
3 changed files with 21 additions and 3 deletions
cmd/tstor

View file

@ -119,9 +119,15 @@ func run(configPath string) error {
return err
}
vfs.Walk(ctx, sfs, "/", func(path string, info fs.FileInfo, err error) error {
return nil
})
go func() {
log := log.WithComponent("background-scanner")
err := vfs.Walk(ctx, sfs, "/", func(path string, info fs.FileInfo, err error) error {
return nil
})
if err != nil {
log.Error(ctx, "error walking filesystem", rlog.Error(err))
}
}()
if conf.Mounts.Fuse.Enabled {
mh := fuse.NewHandler(conf.Mounts.Fuse.AllowOther, conf.Mounts.Fuse.Path)