Skip to content

Commit 3ed60dc

Browse files
author
Witek Bedyk
authored
Merge pull request #6 from mattibf/issue5_flush_logs_on_close
Avoid data loss in stop Send entries before stop (closes #5 )
2 parents f4cda88 + ab9dff4 commit 3ed60dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/logstash/outputs/monasca_log_api.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ def start_time_check
208208
end
209209

210210
def stop_time_check
211+
#ensure that entries buffered in queue will be handled before stop
212+
@mutex.synchronize do
213+
send_logs
214+
end
211215
@time_thread.kill() if @time_thread
212216
@logger.info('Stopped time_check thread')
213217
end

0 commit comments

Comments
 (0)