Merge pull request #3968 from MichaelEischer/cleanup-complete-blob
backup: Remove unused filename parameter from CompleteBlob callback
This commit is contained in:
commit
367f35db27
3 changed files with 7 additions and 7 deletions
|
@ -76,7 +76,7 @@ type Archiver struct {
|
||||||
StartFile func(filename string)
|
StartFile func(filename string)
|
||||||
|
|
||||||
// CompleteBlob is called for all saved blobs for files.
|
// 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
|
// 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
|
// 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) {},
|
CompleteItem: func(string, *restic.Node, *restic.Node, ItemStats, time.Duration) {},
|
||||||
StartFile: func(string) {},
|
StartFile: func(string) {},
|
||||||
CompleteBlob: func(string, uint64) {},
|
CompleteBlob: func(uint64) {},
|
||||||
}
|
}
|
||||||
|
|
||||||
return arch
|
return arch
|
||||||
|
@ -369,7 +369,7 @@ func (arch *Archiver) Save(ctx context.Context, snPath, target string, previous
|
||||||
if arch.allBlobsPresent(previous) {
|
if arch.allBlobsPresent(previous) {
|
||||||
debug.Log("%v hasn't changed, using old list of blobs", target)
|
debug.Log("%v hasn't changed, using old list of blobs", target)
|
||||||
arch.CompleteItem(snPath, previous, previous, ItemStats{}, time.Since(start))
|
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)
|
node, err := arch.nodeFromFileInfo(snPath, target, fi)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return FutureNode{}, false, err
|
return FutureNode{}, false, err
|
||||||
|
|
|
@ -25,7 +25,7 @@ type FileSaver struct {
|
||||||
|
|
||||||
ch chan<- saveFileJob
|
ch chan<- saveFileJob
|
||||||
|
|
||||||
CompleteBlob func(filename string, bytes uint64)
|
CompleteBlob func(bytes uint64)
|
||||||
|
|
||||||
NodeFromFileInfo func(snPath, filename string, fi os.FileInfo) (*restic.Node, error)
|
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,
|
pol: pol,
|
||||||
ch: ch,
|
ch: ch,
|
||||||
|
|
||||||
CompleteBlob: func(string, uint64) {},
|
CompleteBlob: func(uint64) {},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := uint(0); i < fileWorkers; i++ {
|
for i := uint(0); i < fileWorkers; i++ {
|
||||||
|
@ -176,7 +176,7 @@ func (s *FileSaver) saveFile(ctx context.Context, chnker *chunker.Chunker, snPat
|
||||||
return fnr
|
return fnr
|
||||||
}
|
}
|
||||||
|
|
||||||
s.CompleteBlob(f.Name(), uint64(len(chunk.Data)))
|
s.CompleteBlob(uint64(len(chunk.Data)))
|
||||||
|
|
||||||
// collect already completed blobs
|
// collect already completed blobs
|
||||||
for len(results) > 0 {
|
for len(results) > 0 {
|
||||||
|
|
|
@ -184,7 +184,7 @@ func (p *Progress) StartFile(filename string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CompleteBlob is called for all saved blobs for files.
|
// CompleteBlob is called for all saved blobs for files.
|
||||||
func (p *Progress) CompleteBlob(filename string, bytes uint64) {
|
func (p *Progress) CompleteBlob(bytes uint64) {
|
||||||
select {
|
select {
|
||||||
case p.processedCh <- Counter{Bytes: bytes}:
|
case p.processedCh <- Counter{Bytes: bytes}:
|
||||||
case <-p.closed:
|
case <-p.closed:
|
||||||
|
|
Loading…
Reference in a new issue