Skip to content

Commit

Permalink
optimize to split lines
Browse files Browse the repository at this point in the history
  • Loading branch information
tagomoris committed Nov 25, 2016
1 parent 18cb438 commit 06d2d41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ def on_notify
else
@buffer << @io.readpartial(2048, @iobuf)
end
while line = @buffer.slice!(/.*?\n/m)
@lines << line
while idx = @buffer.index("\n")
@lines << @buffer.slice!(0, idx + 1)
end
if @lines.size >= @read_lines_limit
# not to use too much memory in case the file is very large
Expand Down

0 comments on commit 06d2d41

Please sign in to comment.