Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush log messages when exiting #92

Merged
merged 1 commit into from
Aug 10, 2016
Merged

Flush log messages when exiting #92

merged 1 commit into from
Aug 10, 2016

Conversation

dwbutler
Copy link
Owner

@dwbutler dwbutler commented Aug 10, 2016

The current implementation of message buffering puts messages into a queue, and flushes them every five seconds. If the program exits, any messages in the buffer will be lost.

This fixes the issue by automatically flushing the buffer when the program exits. This is done by registering an at_exit block which does a final flush, which will wait for all messages to be flushed. If an exception occurs, it will be logged and ignored.

This option is configurable with the new option buffer_flush_at_exit, which now defaults to true.

Fixes #91

The current implementation of message buffering puts messages into a queue, and flushes them every five seconds. If the program exits, any messages in the buffer will be lost.

This fixes the issue by automatically flushing the buffer when the program exits. This is done by registering an `at_exit` block which does a final flush, which will wait for all messages to be flushed. If an exception occurs, it will be logged and ignored.

This option is configurable with the new option `buffer_flush_at_exit`, which now defaults to `true`.
@dwbutler dwbutler merged commit 5823679 into master Aug 10, 2016
@dwbutler dwbutler deleted the feature/flush-on-exit branch August 10, 2016 01:22
@dwbutler
Copy link
Owner Author

Released in 0.19.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Messages not sending while using rails runner
1 participant