Skip to content

Commit

Permalink
Merge pull request #3138 from mocyuto/fix-tempfile-binmode
Browse files Browse the repository at this point in the history
chunk: fix binmode usage for prevent gc
  • Loading branch information
repeatedly committed Sep 29, 2020
2 parents adca029 + a6b1473 commit d5f23b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/fluent/plugin/buffer/chunk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ def open(**kwargs, &block)
output_io = if chunk_io.is_a?(StringIO)
StringIO.new
else
Tempfile.new('decompressed-data').binmode
Tempfile.new('decompressed-data')
end
output_io.binmode if output_io.is_a?(Tempfile)
decompress(input_io: chunk_io, output_io: output_io)
output_io.seek(0, IO::SEEK_SET)
yield output_io
Expand Down

0 comments on commit d5f23b7

Please sign in to comment.