mirror of
https://github.com/restic/restic.git
synced 2026-05-21 09:35:23 +00:00
archiver: check chunker error before updating the node
This is actually just a cosmetic issue as chunk.Length is 0 if the chunker returned an error.
This commit is contained in:
@@ -174,15 +174,15 @@ func (s *fileSaver) saveFile(ctx context.Context, chnker *chunker.Chunker, snPat
|
||||
buf.Release()
|
||||
break
|
||||
}
|
||||
|
||||
buf.Data = chunk.Data
|
||||
node.Size += uint64(chunk.Length)
|
||||
|
||||
if err != nil {
|
||||
_ = f.Close()
|
||||
completeError(err)
|
||||
return
|
||||
}
|
||||
|
||||
buf.Data = chunk.Data
|
||||
node.Size += uint64(chunk.Length)
|
||||
|
||||
// test if the context has been cancelled, return the error
|
||||
if ctx.Err() != nil {
|
||||
_ = f.Close()
|
||||
|
||||
Reference in New Issue
Block a user