forked from TrueCloudLab/restic
rewrite: non-exclusive lock if snapshots are only added
This commit is contained in:
parent
327f418a9c
commit
375a3db64d
1 changed files with 7 additions and 2 deletions
|
@ -161,9 +161,14 @@ func runRewrite(ctx context.Context, opts RewriteOptions, gopts GlobalOptions, a
|
||||||
}
|
}
|
||||||
|
|
||||||
if !opts.DryRun {
|
if !opts.DryRun {
|
||||||
Verbosef("create exclusive lock for repository\n")
|
|
||||||
var lock *restic.Lock
|
var lock *restic.Lock
|
||||||
lock, ctx, err = lockRepoExclusive(ctx, repo)
|
var err error
|
||||||
|
if opts.Inplace {
|
||||||
|
Verbosef("create exclusive lock for repository\n")
|
||||||
|
lock, ctx, err = lockRepoExclusive(ctx, repo)
|
||||||
|
} else {
|
||||||
|
lock, ctx, err = lockRepo(ctx, repo)
|
||||||
|
}
|
||||||
defer unlockRepo(lock)
|
defer unlockRepo(lock)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue