Skip to content

Commit

Permalink
Merge pull request #6 from mattibf/issue5_flush_logs_on_close
Browse files Browse the repository at this point in the history
Avoid data loss in stop
Send entries before stop (closes #5 )
  • Loading branch information
Witek Bedyk authored Nov 20, 2018
2 parents f4cda88 + ab9dff4 commit 3ed60dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/logstash/outputs/monasca_log_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ def start_time_check
end

def stop_time_check
#ensure that entries buffered in queue will be handled before stop
@mutex.synchronize do
send_logs
end
@time_thread.kill() if @time_thread
@logger.info('Stopped time_check thread')
end
Expand Down

0 comments on commit 3ed60dc

Please sign in to comment.