repair index: improve log output if index cannot be deleted

The operation will always fail with an error if an index cannot be
deleted. Thus, this change is purely cosmetic.
This commit is contained in:
Michael Eischer 2024-04-14 11:51:27 +02:00
parent 7d1b9cde34
commit 310db03c0e

View file

@ -110,8 +110,12 @@ func rebuildIndexFiles(ctx context.Context, repo restic.Repository, removePacks
DeleteProgress: func() *progress.Counter {
return printer.NewCounter("old indexes deleted")
},
DeleteReport: func(id restic.ID, _ error) {
printer.VV("removed index %v\n", id.String())
DeleteReport: func(id restic.ID, err error) {
if err != nil {
printer.VV("failed to remove index %v: %v\n", id.String(), err)
} else {
printer.VV("removed index %v\n", id.String())
}
},
SkipDeletion: skipDeletion,
})