mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
19 lines
498 B
CoffeeScript
19 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
|