Skip to content

Commit

Permalink
Merge pull request #476 from ViacomInc/enhance-redis-logging
Browse files Browse the repository at this point in the history
feat(redis-client): moved error logging to upper scope
  • Loading branch information
micheleriva authored Sep 28, 2021
2 parents 2ecc6cc + b917c2c commit ca9c541
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/data-point-cache/lib/redis-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ function reconnectOnError(err) {
function redisDecorator(redis, resolve, reject) {
let wasConnected = false;
redis.on("error", error => {
console.error("ioredis - error", error.toString());
if (!wasConnected) {
redis.disconnect();
reject(error);
return;
}
console.error("ioredis - error", error.toString());
});

redis.on("ready", () => {
Expand Down

0 comments on commit ca9c541

Please sign in to comment.