forked from TrueCloudLab/restic
cache: remove redundant index file cleanup
addressing code review comments
This commit is contained in:
parent
8a7ae17d4d
commit
a8032c932c
1 changed files with 1 additions and 10 deletions
|
@ -706,19 +706,10 @@ func (r *Repository) prepareCache() error {
|
||||||
return nil
|
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())
|
packs := r.idx.Packs(restic.NewIDSet())
|
||||||
|
|
||||||
// clear old packs
|
// clear old packs
|
||||||
err = r.Cache.Clear(restic.PackFile, packs)
|
err := r.Cache.Clear(restic.PackFile, packs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "error clearing pack files in cache: %v\n", err)
|
fmt.Fprintf(os.Stderr, "error clearing pack files in cache: %v\n", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue