Skip to content

Redis cluster not emitting events #1855

Open
@danish241194

Description

@danish241194
 const Redis  = require("redis");

  const cluster = Redis.createCluster({
      rootNodes: [
        {
          url: 'redis://localhost:7000',
        }]
    });

    cluster.on('ready', () => console.log('Redis Cluster ready'));

   cluster.on('connect', () => console.log('Redis Cluster connect'));

    cluster.on("reconnecting", () => console.log('Redis Cluster reconnecting '));
    cluster.on('error', (err : any) => console.log('Redis Cluster Error', err));
    cluster.connect().then(()=> {
         console.log("connected");
     });

With the above code, I get connected log but i can see 'ready' , 'connect' ,'reconnecting' events are not getting trigerred .

Is there any other way to get ready , connect and reconnecting event when dealing with cluster ?
Environment:

  • "node": ">=12.22.7"
  • Redis Server Version: redis_version:6.2.5
  • node "redis": "^4.0.0",
  • Platform: mac os 10.15.7 , also tried on Amazon Linux 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions