From 88174cd0a480c6cd0be97771c8c82c7678444790 Mon Sep 17 00:00:00 2001 From: Srigovind Nayak Date: Sat, 17 Aug 2024 00:21:49 +0530 Subject: [PATCH] cache: remove redundant index file cleanup addressing code review comments --- internal/repository/repository.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/internal/repository/repository.go b/internal/repository/repository.go index f7fd65c71..d408e3105 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -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) }