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

@@ -245,16 +245,14 @@ func (b *dropboxStorage) Prune(deadline time.Time, pruningPrefix string) (*stora
Pruned: uint(len(matches)),
}
if err := b.DoPrune(b.Name(), len(matches), lenCandidates, func() error {
pruneErr := b.DoPrune(b.Name(), len(matches), lenCandidates, deadline, func() error {
for _, match := range matches {
if _, err := b.client.DeleteV2(files.NewDeleteArg(filepath.Join(b.DestinationPath, match.Name))); err != nil {
return fmt.Errorf("(*dropboxStorage).Prune: Error removing file from Dropbox storage: %w", err)
}
}
return nil
}); err != nil {
return stats, err
}
})
return stats, nil
return stats, pruneErr
}