Skip to content

Commit

Permalink
Apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
joaojunceira-zendesk committed May 29, 2024
1 parent 4fc042e commit bdfa01d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Connection.prototype.connectMethod = function (config, callback) {
}

Connection.prototype.connectReplicaMethod = function (config, callback) {
this.connectRedis(config.redisReplicaUrl, callback)
this.connectRedis(config.redisReplicaUrl, callback, true)
}

Connection.prototype.establish = function (ready) {
Expand Down Expand Up @@ -145,7 +145,7 @@ Connection.prototype.teardown = function (callback) {
}
}

Connection.prototype.connectRedis = function (config, callback) {
Connection.prototype.connectRedis = function (config, callback, isReplica = false) {
let client = new Redis({
port: config.port,
host: config.host,
Expand All @@ -168,7 +168,11 @@ Connection.prototype.connectRedis = function (config, callback) {
}

client.on('ready', function () {
logging.info('Redis client "ready" event.')
if (isReplica) {
logging.info('Redis Replica client "ready" event.')
} else {
logging.info('Redis client "ready" event.')
}
callback(null, client)
})

Expand Down

0 comments on commit bdfa01d

Please sign in to comment.