-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Sentinel: If you subscribe after connection established, you error. #255
Comments
Oh, I should point out that while the rejection occurs, the message is still received:
|
Thank you for the feedback! This issue is related with var redis = new Redis({ db: 10 });
redis.on('connect', function () {
redis.subscribe('anychannel');
}); The error is because ioredis sends the However, pub/sub commands ( |
Release in 1.15.1 🚀 |
Thanks for the quick patch! |
@luin getting this same error with this code |
@seunlanlege This issue has been resolved, so there may be another issue. Could you enable debug mode ( |
@luin here are the logs |
@seunlanlege What's the constructor argument of |
I think its a problem with the code. Redis.config is issued without await, command cant complete before .subscribe, connection is then moved to subscriber mode and cant finish it ie I'm pretty sure if you do await Redis.config() and only then subscribe - you should be good |
Consider the folowing:
If you wait until after the connection even to subscribe the following uncaught promise rejection is fired:
This only seems to happen when sentinels are in use
The text was updated successfully, but these errors were encountered: