mirror of
https://github.com/restic/restic.git
synced 2026-05-08 19:45:25 +00:00
mount: load mount root before reporting readiness
This commit is contained in:
+11
-6
@@ -196,12 +196,12 @@ func runMount(ctx context.Context, opts MountOptions, gopts global.Options, args
|
||||
PathTemplates: opts.PathTemplates,
|
||||
}
|
||||
root := fuse.NewRoot(repo, cfg)
|
||||
|
||||
printer.S("Now serving the repository at %s", mountpoint)
|
||||
printer.S("Use another terminal or tool to browse the contents of this folder.")
|
||||
printer.S("When finished, quit with Ctrl-c here or umount the mountpoint.")
|
||||
|
||||
debug.Log("serving mount at %v", mountpoint)
|
||||
// load repository before reporting the mountpoint
|
||||
printer.S("Loading snapshots...")
|
||||
_, err = root.ReadDirAll(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
done := make(chan struct{})
|
||||
|
||||
@@ -210,6 +210,11 @@ func runMount(ctx context.Context, opts MountOptions, gopts global.Options, args
|
||||
err = fs.Serve(c, root)
|
||||
}()
|
||||
|
||||
printer.S("Now serving the repository at %s", mountpoint)
|
||||
printer.S("Use another terminal or tool to browse the contents of this folder.")
|
||||
printer.S("When finished, quit with Ctrl-c here or umount the mountpoint.")
|
||||
debug.Log("serving mount at %v", mountpoint)
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
debug.Log("running umount cleanup handler for mount at %v", mountpoint)
|
||||
|
||||
Reference in New Issue
Block a user