Skip to content

Commit

Permalink
Merge pull request #37 from mixmaxhq/dnechay/RCA-262
Browse files Browse the repository at this point in the history
fix: implicit redis connection errors
  • Loading branch information
dnechay authored Sep 4, 2024
2 parents 48d200d + d340478 commit de3dfe6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class Lock {
} else {
// We assume `options.redis` is a connection string or options object.
this._redisConnection = redis.createClient(options.redis);
/**
* Handle errors to avoid process crashes due to unhandled EventEmitter
*/
this._redisConnection.on('error', noop);
this._redisSubscriber = redis.createClient(options.redis);
}
/**
Expand Down

0 comments on commit de3dfe6

Please sign in to comment.