2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-23 05:12:10 +00:00

cache: remove redundant index file cleanup

addressing code review comments
This commit is contained in:
Srigovind Nayak 2024-08-17 00:21:49 +05:30
parent b7d014b685
commit 88174cd0a4
No known key found for this signature in database
GPG Key ID: 3C4A72A34ABD4C43

View File

@ -706,19 +706,10 @@ func (r *Repository) prepareCache() error {
return nil
}
indexIDs := r.idx.IDs()
debug.Log("prepare cache with %d index files", len(indexIDs))
// clear old index files
err := r.Cache.Clear(restic.IndexFile, indexIDs)
if err != nil {
fmt.Fprintf(os.Stderr, "error clearing index files in cache: %v\n", err)
}
packs := r.idx.Packs(restic.NewIDSet())
// clear old packs
err = r.Cache.Clear(restic.PackFile, packs)
err := r.Cache.Clear(restic.PackFile, packs)
if err != nil {
fmt.Fprintf(os.Stderr, "error clearing pack files in cache: %v\n", err)
}