cache: check for context cancellation before clearing cache

This commit is contained in:
Srigovind Nayak 2024-08-11 15:43:03 +05:30
parent f66624f5bf
commit a23e7bfb82
No known key found for this signature in database
GPG key ID: 3C4A72A34ABD4C43

View file

@ -247,6 +247,10 @@ func (b *Backend) List(ctx context.Context, t backend.FileType, fn func(f backen
return err
}
if ctx.Err() != nil {
return ctx.Err()
}
// clear the cache for files that are not in the repo anymore, ignore errors
err = b.Cache.Clear(t, ids)
if err != nil {