Skip to content

Commit f711717

Browse files
authored
fix: connect if redis client has status "wait"
Summary: When supplying your own IORedis instance and `lazyConnect` is true, the RedisConnection instance will not connect on its own because it does not check if it's `status` is "wait". While this may be intended behavior, there is no direct way to call `connect` on the duplicated Redis instance causing it to never connect and indefinitely wait until ready.
1 parent 451365c commit f711717

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/classes/redis-connection.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ export class RedisConnection extends EventEmitter {
6666

6767
client.once('ready', handleReady);
6868
client.once('error', handleError);
69+
70+
if (client.status === 'wait') {
71+
client.connect();
72+
}
6973
}
7074
});
7175
}

0 commit comments

Comments
 (0)