Pruning method logs nonsensical configuration values (#301)

* Pruning method logs nonsensical configuration values

* Adjust test assertion about log output
This commit is contained in:
Frederik Ring
2023-11-04 12:19:44 +01:00
committed by GitHub
parent d3e1d1531b
commit 0325889ac4
9 changed files with 38 additions and 46 deletions

View File

@@ -116,7 +116,7 @@ func (b *localStorage) Prune(deadline time.Time, pruningPrefix string) (*storage
Pruned: uint(len(matches)),
}
if err := b.DoPrune(b.Name(), len(matches), len(candidates), func() error {
pruneErr := b.DoPrune(b.Name(), len(matches), len(candidates), deadline, func() error {
var removeErrors []error
for _, match := range matches {
if err := os.Remove(match); err != nil {
@@ -131,11 +131,9 @@ func (b *localStorage) Prune(deadline time.Time, pruningPrefix string) (*storage
)
}
return nil
}); err != nil {
return stats, err
}
})
return stats, nil
return stats, pruneErr
}
// copy creates a copy of the file located at `dst` at `src`.