From 054ea9e7d9fe9bec26c85b67585d469fcc8495eb Mon Sep 17 00:00:00 2001 From: Andreas Kotes Date: Tue, 17 Sep 2019 15:29:43 +0200 Subject: [PATCH] Allow compressing buffer files during restore Signed-off-by: Andreas Kotes --- lib/fluent/plugin/buf_file.rb | 2 +- lib/fluent/plugin/buf_file_single.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fluent/plugin/buf_file.rb b/lib/fluent/plugin/buf_file.rb index 6463922225..c56425f018 100644 --- a/lib/fluent/plugin/buf_file.rb +++ b/lib/fluent/plugin/buf_file.rb @@ -146,7 +146,7 @@ def resume end begin - chunk = Fluent::Plugin::Buffer::FileChunk.new(m, path, mode) # file chunk resumes contents of metadata + chunk = Fluent::Plugin::Buffer::FileChunk.new(m, path, mode, compress: @compress) # file chunk resumes contents of metadata rescue Fluent::Plugin::Buffer::FileChunk::FileChunkError => e handle_broken_files(path, mode, e) next diff --git a/lib/fluent/plugin/buf_file_single.rb b/lib/fluent/plugin/buf_file_single.rb index 2f71415288..a4f4455f12 100644 --- a/lib/fluent/plugin/buf_file_single.rb +++ b/lib/fluent/plugin/buf_file_single.rb @@ -167,7 +167,7 @@ def resume end begin - chunk = Fluent::Plugin::Buffer::FileSingleChunk.new(m, path, mode, @key_in_path) + chunk = Fluent::Plugin::Buffer::FileSingleChunk.new(m, path, mode, @key_in_path, compress: @compress) chunk.restore_size(@chunk_format) if @calc_num_records rescue Fluent::Plugin::Buffer::FileSingleChunk::FileChunkError => e handle_broken_files(path, mode, e)