mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-30 22:10:59 +00:00
14 lines
516 B
CoffeeScript
14 lines
516 B
CoffeeScript
Settings = require 'settings-sharelatex'
|
|
redis = require 'redis-sharelatex'
|
|
|
|
# A per-feature interface to Redis,
|
|
# looks up the feature in `settings.redis`
|
|
# and returns an appropriate client.
|
|
# Necessary because we don't want to migrate web over
|
|
# to redis-cluster all at once.
|
|
module.exports = Redis =
|
|
# feature = 'websessions' | 'ratelimiter' | ...
|
|
client: (feature) ->
|
|
redisFeatureSettings = Settings.redis[feature] or Settings.redis.web
|
|
rclient = redis.createClient(redisFeatureSettings)
|
|
return rclient
|