mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 09:23:33 -05:00
18 lines
No EOL
643 B
CoffeeScript
18 lines
No EOL
643 B
CoffeeScript
redis = require("redis-sharelatex")
|
|
logger = require 'logger-sharelatex'
|
|
|
|
module.exports = RedisClientManager =
|
|
createClientList: (configs...) ->
|
|
# create a dynamic list of redis clients, excluding any configurations which are not defined
|
|
clientList = for x in configs when x?
|
|
redisType = if x.cluster?
|
|
"cluster"
|
|
else if x.sentinels?
|
|
"sentinel"
|
|
else if x.host?
|
|
"single"
|
|
else
|
|
"unknown"
|
|
logger.log {redis: redisType}, "creating redis client"
|
|
redis.createClient(x)
|
|
return clientList |