mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
18 lines
498 B
CoffeeScript
18 lines
498 B
CoffeeScript
Settings = require 'settings-sharelatex'
|
|
redis = require 'redis-sharelatex'
|
|
ioredis = require 'ioredis'
|
|
logger = require 'logger-sharelatex'
|
|
|
|
module.exports = Redis =
|
|
|
|
client: () ->
|
|
|
|
redisSessionsSettings = Settings.redis.websessions or Settings.redis.web
|
|
|
|
if redisSessionsSettings?.cluster?
|
|
logger.log {}, "using redis cluster for web sessions"
|
|
rclient = new ioredis.Cluster(redisSessionsSettings.cluster)
|
|
else
|
|
rclient = redis.createClient(redisSessionsSettings)
|
|
|
|
return rclient
|