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

Infinity loop of connect event #1341

Open
MaestroJurko opened this issue Apr 21, 2021 · 2 comments
Open

Infinity loop of connect event #1341

MaestroJurko opened this issue Apr 21, 2021 · 2 comments

Comments

@MaestroJurko
Copy link

MaestroJurko commented Apr 21, 2021

Not getting ready event to be triggered. The connected event is triggered but ready is not.

Implementation:

    const client = new Cluster(
        [
          {
            host: '127.0.0.1',
            port: 7000,
          },
        ],
        {
          dnsLookup: (address, callback) => callback(null, address),
          redisOptions: {
          },
        },
      );

    client.on('ready', () => {
        log.info('Ready to use Redis');
      });

      client.on('connect', () => {
        log.info('Connected to Redis');
      });

      client.on('error', (x) => {
        log.error(`Disconnected from Redis`);
      });

Dockerhub:

  redis-cluster:
    image: grokzen/redis-cluster
    environment:
      MASTERS: 1
      SLAVES_PER_MASTER: 1
    ports:
      - "7000:7000"

ioredis version: 4.26.0

@StarpTech
Copy link

As descibed in the docs https://github.com/luin/ioredis#connection-events You have to use enableReadyCheck: true

@shahinghasemi
Copy link

I have the same issue. @StarpTech It's true by default. even explicitly setting it to true doesn't resolve the issue.

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

No branches or pull requests

3 participants