Skip to content

Commit 3bcb501

Browse files
janosgbalint
authored andcommitted
swarm/api: close tar writer in GetDirectoryTar to flush and clean (#17339)
1 parent d3e4c2d commit 3bcb501

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎swarm/api/api.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,10 @@ func (a *API) GetDirectoryTar(ctx context.Context, uri *URI) (io.ReadCloser, err
525525

526526
return nil
527527
})
528+
// close tar writer before closing pipew
529+
// to flush remaining data to pipew
530+
// regardless of error value
531+
tw.Close()
528532
if err != nil {
529533
apiGetTarFail.Inc(1)
530534
pipew.CloseWithError(err)

0 commit comments

Comments
 (0)