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

Feature Request: Check if Redis-Server available #26

Closed
queequac opened this issue Sep 5, 2014 · 4 comments · Fixed by #160
Closed

Feature Request: Check if Redis-Server available #26

queequac opened this issue Sep 5, 2014 · 4 comments · Fixed by #160

Comments

@queequac
Copy link

queequac commented Sep 5, 2014

Currently an exception is thrown if the specified redis server is not available.
Unfortunately the exception is thrown async by some event where no reasonable try-catch can be put in place.

Would be nice if socket.io-redis would provide functionality to check whether a configuration (host:port) is currently available/valid or not.

@rase-
Copy link
Contributor

rase- commented Sep 25, 2014

I think we could make the error handling easier definitely. Thoughts, @guille?

@peteruithoven
Copy link

Since Adapter is an EventEmitter, maybe it could forward the error event?
So listening to error events on the pub and sub clients, when it occors emit an error event through the adapter instance so that users can listen to it.

I believe a workaround would be to supply your own pub and sub clients and listen for the error event on them.

@peteruithoven
Copy link

Somehow there is another error not caught, one that probably should be caught using a callback function.

/Applications/AMPPS/www/nodejs/Socket.io-redis-pubsub/node_modules/redis/index.js:158
                    throw callback_err;
                          ^
Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED
    at RedisClient.flush_and_error (/Applications/AMPPS/www/nodejs/Socket.io-redis-pubsub/node_modules/redis/index.js:149:13)
    at RedisClient.on_error (/Applications/AMPPS/www/nodejs/Socket.io-redis-pubsub/node_modules/redis/index.js:191:10)
    at Socket.<anonymous> (/Applications/AMPPS/www/nodejs/Socket.io-redis-pubsub/node_modules/redis/index.js:106:14)
    at Socket.emit (events.js:95:17)
    at net.js:440:14
    at process._tickCallback (node.js:419:13)

@peteruithoven
Copy link

The uncaught error is caused by: #21

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

Successfully merging a pull request may close this issue.

3 participants