deleteFiles deletes the given fileList of fileType in parallel if ignoreError=true, it will print a warning if there was an error, else it will abort.
(ctx context.Context, ignoreError bool, repo restic.RemoverUnpacked[restic.FileType], fileList restic.IDSet, fileType restic.FileType, printer progress.Printer)
| 666 | // deleteFiles deletes the given fileList of fileType in parallel |
| 667 | // if ignoreError=true, it will print a warning if there was an error, else it will abort. |
| 668 | func deleteFiles(ctx context.Context, ignoreError bool, repo restic.RemoverUnpacked[restic.FileType], fileList restic.IDSet, fileType restic.FileType, printer progress.Printer) error { |
| 669 | bar := printer.NewCounter("files deleted") |
| 670 | defer bar.Done() |
| 671 | |
| 672 | return restic.ParallelRemove(ctx, repo, fileList, fileType, func(id restic.ID, err error) error { |
| 673 | if err != nil { |
| 674 | printer.E("unable to remove %v/%v from the repository", fileType, id) |
| 675 | if !ignoreError { |
| 676 | return err |
| 677 | } |
| 678 | } |
| 679 | printer.VV("removed %v/%v", fileType, id) |
| 680 | return nil |
| 681 | }, bar) |
| 682 | } |
no test coverage detected