-
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
Unhandled 'error' event #1110
Comments
It might be because ioredis will try to connect upon using You could try adding |
I'm using |
Also having this issue, but with lazyConnect: true already set |
I also have this problem!! |
Does adding a disconnect to the error handler fix the issue? This should work, I also fixed a few typos. const IORedis = require('ioredis');
let cluster = new IORedis.Cluster([{
host: '192.168.1.71',
port: 7000
}, {
host: '192.168.1.71',
port: 7001
}, {
host: '192.168.1.71',
port: 7002
}], {
clusterRetryStrategy: function() {
let delay = Math.min(2000 + times * 50, 10000);
return delay;
}
});
cluster.on('connect', function() {
console.log(`Redis Cluster connected `);
});
cluster.on('error', function(err) {
cluster.disconnect();
console.error('Redis Cluster error', err);
}); |
have you all solved this issue? I am having the same issue. Although I try to catch the error with Update: |
Hi,I am trying to connect redis cluster by ioredis.
node version: 10.19.0
ioredis: 4.16.3
I met "Unhandled 'error' event" error message and my application crashed when I disconnect from the network.
Actually I have listened the "error event" in my code,but I still met the error.
My code is as follows.
The text was updated successfully, but these errors were encountered: