Skip to content

Event for reconnection giving up #586

@PaquitoSoft

Description

@PaquitoSoft

Hello:

I think it would be great if the client would emit an event when it gives up trying to reconnect to a dead Redis instance because a user configured it to do so using connect_timeout or max_attempts attributes.

I mean updating this code:

if (self.connect_timeout && self.retry_totaltime >= self.connect_timeout) {
    self.retry_timer = null;
    // TODO - engage Redis is Broken mode for future commands, or whatever
    console.error("node_redis: Couldn't get Redis connection after " + self.retry_totaltime + "ms.");
    return;
}

to look something like this:

if (self.connect_timeout && self.retry_totaltime >= self.connect_timeout) {
    self.retry_timer = null;
    self.emit('reconnectionGiveup');
    return;
}

and the same for the max_attemps case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions