Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/logdna/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def schedule_flush
sleep(@exception_flag ? @retry_timeout : @flush_interval)
flush if @flush_scheduled
}
thread = Thread.new { start_timer }
thread = Thread.new { start_timer.call }
thread.join
end

Expand All @@ -62,8 +62,11 @@ def write_to_buffer(msg, opts)
@flush_scheduled = true
@lock.unlock

flush if @flush_limit <= @buffer_byte_size
schedule_flush unless @flush_scheduled
if @flush_limit <= @buffer_byte_size
flush
else
schedule_flush
end
else
@side_message_lock.synchronize do
@side_messages.push(process_message(msg, opts))
Expand Down