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
Try if Redis server is running #138
Comments
This is happening because the client is emitting an "error" event. In node, events named "error" are special. If you don't listen for them, they get converted into exceptions. So get a listener for "error" on your client, and you won't crash. We automatically retry on connection refused, so this should work itself out once you listen for errors. I'm going to rework the way reconnections and errors are handled though, because this very common scenario ends up being confusing to a lot of people. |
Has any of this been handled! I'm trying to catch the errors in a try catch block. But, it's not working. |
const client = redis.createClient({
|
[master] Starting Cryptonote Node.JS pool version v2.0.0 I'm so tired, I have no hope :( I'm using Ubuntu Server 20 |
I have a node.js server starting at boot with Ubuntu's
upstart
. Because the node.js server starts before Redis is up and running,redis.createClient()
throws an exception:Of course I try to wrap it in a try/catch statement. The start of my server:
However, this doesn't make any difference, I still got an exception. What can be the case and how can I make sure my server waits before Redis is there?
The text was updated successfully, but these errors were encountered: