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

Add ability to drain redis queue before closing logger, update Redis client library version #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thecubed
Copy link

No description provided.

if (this.redis) {
// Wait for 'drain' event from redis, else we might end the connection before the queue is empt
var rclient = this.redis;
rclient.on("drain", function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the drain event is never emitted?

@thecubed
Copy link
Author

I believe if the 'drain' event isn't emitted by the Redis library that the logger will hang until Redis's queue is empty. This would prevent messages from being dropped that were queued when the log.close() method is called.

I can check and see if there's a way to have Winston pass a value along to us that allows for force closing the connection by default or to wait for the drain event and close gracefully if set.

@yads
Copy link
Contributor

yads commented Dec 11, 2015

@thecubed I think that would be preferable, thanks.

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

Successfully merging this pull request may close these issues.

2 participants