mirror of
https://github.com/octoleo/restic.git
synced 2024-12-03 18:38:20 +00:00
forget: replace usage of DeleteFilesChecked
This simplifies refactoring prune into the repository package.
This commit is contained in:
parent
6091029fd6
commit
739d11c2eb
@ -267,7 +267,17 @@ func runForget(ctx context.Context, opts ForgetOptions, pruneOptions PruneOption
|
|||||||
|
|
||||||
if len(removeSnIDs) > 0 {
|
if len(removeSnIDs) > 0 {
|
||||||
if !opts.DryRun {
|
if !opts.DryRun {
|
||||||
err := DeleteFilesChecked(ctx, gopts, repo, removeSnIDs, restic.SnapshotFile)
|
bar := newProgressMax(!gopts.JSON && !gopts.Quiet, 0, "files deleted")
|
||||||
|
err := restic.ParallelRemove(ctx, repo, removeSnIDs, restic.SnapshotFile, func(id restic.ID, err error) error {
|
||||||
|
if err != nil {
|
||||||
|
Warnf("unable to remove %v/%v from the repository\n", restic.SnapshotFile, id)
|
||||||
|
}
|
||||||
|
if !gopts.JSON && gopts.verbosity > 2 {
|
||||||
|
Verbosef("removed %v/%v\n", restic.SnapshotFile, id)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}, bar)
|
||||||
|
bar.Done()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user