Skip to content

Commit

Permalink
fix: properly close records on error.
Browse files Browse the repository at this point in the history
  • Loading branch information
NGTmeaty authored Jul 3, 2022
1 parent c5c1111 commit 8a39cde
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,8 @@ func (d *customDialer) writeWARCFromConnection(reqPipe, respPipe *io.PipeReader,
close(recordChan)
if err != nil {
d.client.errChan <- err

// Make sure we close the WARC content buffers
for _, record := range batch.Records {
for record := range recordChan {
record.Content.Close()
}

Expand Down

0 comments on commit 8a39cde

Please sign in to comment.