diff --git a/internal/archiver/archiver.go b/internal/archiver/archiver.go index 7e5cd5e69..23ff14a26 100644 --- a/internal/archiver/archiver.go +++ b/internal/archiver/archiver.go @@ -76,7 +76,7 @@ type Archiver struct { StartFile func(filename string) // CompleteBlob is called for all saved blobs for files. - CompleteBlob func(filename string, bytes uint64) + CompleteBlob func(bytes uint64) // WithAtime configures if the access time for files and directories should // be saved. Enabling it may result in much metadata, so it's off by @@ -149,7 +149,7 @@ func New(repo restic.Repository, fs fs.FS, opts Options) *Archiver { CompleteItem: func(string, *restic.Node, *restic.Node, ItemStats, time.Duration) {}, StartFile: func(string) {}, - CompleteBlob: func(string, uint64) {}, + CompleteBlob: func(uint64) {}, } return arch @@ -369,7 +369,7 @@ func (arch *Archiver) Save(ctx context.Context, snPath, target string, previous if arch.allBlobsPresent(previous) { debug.Log("%v hasn't changed, using old list of blobs", target) arch.CompleteItem(snPath, previous, previous, ItemStats{}, time.Since(start)) - arch.CompleteBlob(snPath, previous.Size) + arch.CompleteBlob(previous.Size) node, err := arch.nodeFromFileInfo(snPath, target, fi) if err != nil { return FutureNode{}, false, err diff --git a/internal/archiver/file_saver.go b/internal/archiver/file_saver.go index 460ba7457..fc008945c 100644 --- a/internal/archiver/file_saver.go +++ b/internal/archiver/file_saver.go @@ -25,7 +25,7 @@ type FileSaver struct { ch chan<- saveFileJob - CompleteBlob func(filename string, bytes uint64) + CompleteBlob func(bytes uint64) NodeFromFileInfo func(snPath, filename string, fi os.FileInfo) (*restic.Node, error) } @@ -45,7 +45,7 @@ func NewFileSaver(ctx context.Context, wg *errgroup.Group, save SaveBlobFn, pol pol: pol, ch: ch, - CompleteBlob: func(string, uint64) {}, + CompleteBlob: func(uint64) {}, } for i := uint(0); i < fileWorkers; i++ { @@ -176,7 +176,7 @@ func (s *FileSaver) saveFile(ctx context.Context, chnker *chunker.Chunker, snPat return fnr } - s.CompleteBlob(f.Name(), uint64(len(chunk.Data))) + s.CompleteBlob(uint64(len(chunk.Data))) // collect already completed blobs for len(results) > 0 { diff --git a/internal/ui/backup/progress.go b/internal/ui/backup/progress.go index 6d0b60c04..d5297eb2e 100644 --- a/internal/ui/backup/progress.go +++ b/internal/ui/backup/progress.go @@ -184,7 +184,7 @@ func (p *Progress) StartFile(filename string) { } // CompleteBlob is called for all saved blobs for files. -func (p *Progress) CompleteBlob(filename string, bytes uint64) { +func (p *Progress) CompleteBlob(bytes uint64) { select { case p.processedCh <- Counter{Bytes: bytes}: case <-p.closed: