Skip to content


Subversion checkout URL

You can clone with
Download ZIP


connect-redis should listen the error event. #34

jerem opened this Issue · 6 comments

6 participants


Otherwise node_redis will not try to reconnect to the redis server.


As it's configured, out of the box (unless I'm missing something) connect-redis will crash your node instance when you restart redis.

Can you update the basic example to include whatever code is needed to handle a redis crash? Have you considered giving retry logic to connect-redis with backoff, etc? Or making lazy connections to redis on an as needed basis? Most distributed systems assume a faulty network and crashy servers.

Thanks for a cool middleware!


+1 @ozten, app gets crashed after Redis disconnect + reconnect (connect-redis@1.4.6). Normally Redis client has a reconnect ability, not sure why connect-redis does not reconnect. See this gist discussion for possible solution.


ok. I will look into this tomorrow.


Closing this, node_redis will auto-reconnect when a disconnect occurs. If it doesn't, that's an issue with node_redis (connect-redis isn't doing anything special here). 2.1.0 is using latest redis.

@wavded wavded closed this

Investigated this a while ago; FWIW node-redis reconnects quite well as long as you explicitly listen to its error event (this was pretty undocumented back then).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.