overleaf/services/real-time/app/js/RedisClientManager.js
Brian Gough 618cf99548 Merge pull request #4950 from overleaf/bg-realtime-log-relevelling
realtime log re-levelling

GitOrigin-RevId: 81d86ba648e7fc1436b638b67371b35fd831a62f
2021-09-15 08:03:25 +00:00

19 lines
558 B
JavaScript

const redis = require('@overleaf/redis-wrapper')
const logger = require('logger-sharelatex')
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)
})
},
}