mirror of
https://github.com/restic/restic.git
synced 2024-12-23 08:16:36 +00:00
Merge pull request 2081 from restic/fix-2080
backup: Open repository before async status starts
This commit is contained in:
commit
c8fc72364a
1 changed files with 6 additions and 6 deletions
|
@ -385,6 +385,12 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
|
||||||
|
|
||||||
var t tomb.Tomb
|
var t tomb.Tomb
|
||||||
|
|
||||||
|
term.Print("open repository\n")
|
||||||
|
repo, err := OpenRepository(gopts)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
p := ui.NewBackup(term, gopts.verbosity)
|
p := ui.NewBackup(term, gopts.verbosity)
|
||||||
|
|
||||||
// use the terminal for stdout/stderr
|
// use the terminal for stdout/stderr
|
||||||
|
@ -406,12 +412,6 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
|
||||||
|
|
||||||
t.Go(func() error { return p.Run(t.Context(gopts.ctx)) })
|
t.Go(func() error { return p.Run(t.Context(gopts.ctx)) })
|
||||||
|
|
||||||
p.V("open repository")
|
|
||||||
repo, err := OpenRepository(gopts)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
p.V("lock repository")
|
p.V("lock repository")
|
||||||
lock, err := lockRepo(repo)
|
lock, err := lockRepo(repo)
|
||||||
defer unlockRepo(lock)
|
defer unlockRepo(lock)
|
||||||
|
|
Loading…
Reference in a new issue