overleaf/services/real-time/app/js/RedisClientManager.js
Alf Eaton 6cc2db3cdd Merge pull request #17525 from overleaf/ae-upgrade-prettier
Upgrade Prettier to v3

GitOrigin-RevId: 6f1338f196408f3edb4892d5220ad3665ff1a5bc
2024-03-26 09:04:05 +00:00

19 lines
569 B
JavaScript

const redis = require('@overleaf/redis-wrapper')
const logger = require('@overleaf/logger')
module.exports = {
createClientList(...configs) {
// create a dynamic list of redis clients, excluding any configurations which are not defined
return configs.filter(Boolean).map(x => {
const redisType = x.cluster
? 'cluster'
: x.sentinels
? 'sentinel'
: x.host
? 'single'
: 'unknown'
logger.debug({ redis: redisType }, 'creating redis client')
return redis.createClient(x)
})
},
}