pass context to Find / FindSnapshot

This allows proper interruption of restic while it searches for
snapshots or key files.
This commit is contained in:
Michael Eischer committed 2020-10-09 22:37:56 +02:00
1 parent 5fd3dbccb7
commit c458e114d4
13 files changed
+24 -24

No files matched your search

+1 -1
View File
@@ -116,7 +116,7 @@ func SearchKey(ctx context.Context, s *Repository, password string, maxKeys int,
checked := 0
if len(keyHint) > 0 {
id, err := restic.Find(s.Backend(), restic.KeyFile, keyHint)
id, err := restic.Find(ctx, s.Backend(), restic.KeyFile, keyHint)
if err == nil {
key, err := OpenKey(ctx, s, id, password)
+2 -2
View File
@@ -72,8 +72,8 @@ func (r *Repository) UseCache(c *cache.Cache) {
// PrefixLength returns the number of bytes required so that all prefixes of
// all IDs of type t are unique.
func (r *Repository) PrefixLength(t restic.FileType) (int, error) {
return restic.PrefixLength(r.be, t)
func (r *Repository) PrefixLength(ctx context.Context, t restic.FileType) (int, error) {
return restic.PrefixLength(ctx, r.be, t)
}
// LoadAndDecrypt loads and decrypts the file with the given type and ID, using