cmd/restic: Add lock handling, interrupt cleanup

This commit is contained in:
Alexander Neumann
2015-06-27 15:05:20 +02:00
parent 65a0def949
commit 13e9a35f96
11 changed files with 100 additions and 22 deletions

View File

@@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"github.com/restic/restic"
"github.com/restic/restic/backend"
"github.com/restic/restic/repository"
)
@@ -122,8 +121,8 @@ func (cmd CmdKey) Execute(args []string) error {
return err
}
lock, err := restic.NewExclusiveLock(repo)
defer lock.Unlock()
lock, err := lockRepoExclusive(repo)
defer unlockRepo(lock)
if err != nil {
return err
}