Skip to content

Commit

Permalink
out_file: remove workaround for Ruby 2.7 and 3.0 on macOS
Browse files Browse the repository at this point in the history
Signed-off-by: Shizuo Fujita <[email protected]>
  • Loading branch information
Watson1978 committed Jan 15, 2025
1 parent 26812c8 commit 92852d9
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions lib/fluent/plugin/out_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,6 @@ def configure(conf)
@dir_perm = system_config.dir_permission || Fluent::DEFAULT_DIR_PERMISSION
@file_perm = system_config.file_permission || Fluent::DEFAULT_FILE_PERMISSION
@need_lock = system_config.workers > 1

# https://github.com/fluent/fluentd/issues/3569
@need_ruby_on_macos_workaround = false
if @append && Fluent.macos?
condition = Gem::Dependency.new('', [">= 2.7.0", "< 3.1.0"])
@need_ruby_on_macos_workaround = true if condition.match?('', RUBY_VERSION)
end
end

def multi_workers_ready?
Expand Down Expand Up @@ -244,12 +237,7 @@ def write(chunk)

def write_without_compression(path, chunk)
File.open(path, "ab", @file_perm) do |f|
if @need_ruby_on_macos_workaround
content = chunk.read()
f.puts content
else
chunk.write_to(f)
end
chunk.write_to(f)
end
end

Expand Down

0 comments on commit 92852d9

Please sign in to comment.