MCPcopy
hub / github.com/restic/restic / deleteFiles

Function deleteFiles

internal/repository/prune.go:668–682  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
668func 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}

Callers 1

ExecuteMethod · 0.85

Calls 5

DoneMethod · 0.95
ParallelRemoveFunction · 0.92
NewCounterMethod · 0.65
EMethod · 0.65
VVMethod · 0.65

Tested by

no test coverage detected