forked from TrueCloudLab/restic
cache: check for context cancellation before clearing cache
This commit is contained in:
parent
f66624f5bf
commit
a23e7bfb82
1 changed files with 4 additions and 0 deletions
4
internal/backend/cache/backend.go
vendored
4
internal/backend/cache/backend.go
vendored
|
@ -247,6 +247,10 @@ func (b *Backend) List(ctx context.Context, t backend.FileType, fn func(f backen
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ctx.Err() != nil {
|
||||||
|
return ctx.Err()
|
||||||
|
}
|
||||||
|
|
||||||
// clear the cache for files that are not in the repo anymore, ignore errors
|
// clear the cache for files that are not in the repo anymore, ignore errors
|
||||||
err = b.Cache.Clear(t, ids)
|
err = b.Cache.Clear(t, ids)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue