mirror of
https://github.com/octoleo/restic.git
synced 2025-01-05 16:12:29 +00:00
repo: Clear indexes
This commit is contained in:
parent
7a5fde8f5a
commit
70248bd05a
@ -371,10 +371,22 @@ func (r *Repository) LoadIndex(ctx context.Context) error {
|
|||||||
ParallelWorkFuncParseID(worker))
|
ParallelWorkFuncParseID(worker))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
validIndex := restic.NewIDSet()
|
||||||
for idx := range indexes {
|
for idx := range indexes {
|
||||||
|
id, err := idx.ID()
|
||||||
|
if err == nil {
|
||||||
|
validIndex.Insert(id)
|
||||||
|
}
|
||||||
r.idx.Insert(idx)
|
r.idx.Insert(idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.Cache != nil {
|
||||||
|
err := r.Cache.Clear(restic.IndexFile, validIndex)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "error clearing index files in cache: %v\n", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := <-errCh; err != nil {
|
if err := <-errCh; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user