Skip to content

Commit

Permalink
Make the Redis connection more robust
Browse files Browse the repository at this point in the history
When Redis resets the connection, the ECONNRESET error cause the nodejs server
to exit. Capture and log it so that the server lives on. It will reconnect, and
perhaps we'll learn that different errors require different handling after
enough logging.
  • Loading branch information
inkblot committed Jul 27, 2015
1 parent 2bc0122 commit 49a6f7d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ if (process.env.REDIS_SECRET) {
client.auth(process.env.REDIS_SECRET);
}

client.on('error', function (err) {
console.log('Redis client error: ' + err);
});

app.use(function* () {

Expand Down

0 comments on commit 49a6f7d

Please sign in to comment.