mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 04:23:39 -05:00
19 lines
556 B
JavaScript
19 lines
556 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.log({ redis: redisType }, 'creating redis client')
|
|
return redis.createClient(x)
|
|
})
|
|
},
|
|
}
|