Skip to content

Commit

Permalink
fix: breaking changes of redis-async
Browse files Browse the repository at this point in the history
  • Loading branch information
osher committed Jul 9, 2024
1 parent 2f7ad17 commit 459a7fe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/test-db-redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ module.exports = ({
(c
? Promise.resolve(c)
: new Promise(
(accept, reject) =>
(accept, reject) => {
mgr.client = c = redis(redisOptions)
.on('error', reject)
.once('connect', () => c.removeListener('error', reject) && accept(c)),
c.on('error', reject)
c.once('connect', () => c.removeListener('error', reject) && accept(c))
return c
},
)
)
.then(
({ server_info: { redis_version: version, role }, address, selected_db: db = 0 }) =>
({ __redisClient: { server_info: { redis_version: version, role } }, address, selected_db: db = 0 }) =>
Object.assign(c, {
[util.inspect.custom]: () => `${blue('[RedisClient]')} { @ ${color(address)}, role: ${color(role)}, dbVer: ${color(version)}, #db: ${color(db)} }`, //eslint-disable-line max-len
}),
Expand Down

0 comments on commit 459a7fe

Please sign in to comment.