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:
Michael Eischer
2026-05-16 12:03:43 +02:00
parent b7d8c98214
commit 3148494a92
+4 -4
View File
@@ -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()