Skip to content

Conversation

@willyjchen
Copy link

This fix a bug that this.connected is not initialized if the redis connect event is missed.

Check if the connect event is missed or not, then emit the missed connect event again.

This fix a bug that this.connected is not initialized if the redis connect event is missed.

Check if the connect event is missed or not, then emit the missed connect event again.
}.bind(this));

if ( this.client.connected ) {
this.client.emit('connect');
Copy link

Choose a reason for hiding this comment

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

I think resending connect on client is not good idea. Because there could be some subscribers that will not expect this.
You should better directly set self.connected.

1. Avoid resenting redis 'connect' event as suggested change
2. Add check of 'this.connected' to prevent init twice
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