-
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
Cannot connect after quit command #928
Comments
Thank you for pointing this out. This is a bug happening when connecting immediately after "end", thus changing: try {
await client.connect();
} catch (err) {
console.error(err);
} to setTimeout(() => {
client.connect();
}, 0) Will avoid the reconnecting and will be able to connect successfully. This issue is caused by the handlers for the events emitted from the previous connection being executed during the next connection being made. I created a pull request to fix this issue by introducing a connection epoch to distinguish different connections. |
Introduce a connection epoch to distinguish different connections. Close #928
🎉 This issue has been resolved in version 4.12.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [4.12.1](redis/ioredis@v4.12.0...v4.12.1) (2019-07-15) ### Bug Fixes * handle connecting immediately after "end" event ([#929](redis/ioredis#929)) ([7bcd8a8](redis/ioredis@7bcd8a8)), closes [#928](redis/ioredis#928)
Trying to connect after calling quit results in the following exception:
How to reproduce:
From what I can understand from the code it seems that the status property is not properly updated in the case of quit (or disconnect btw).
The text was updated successfully, but these errors were encountered: