1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2024-12-18 11:42:39 -05:00
overleaf/services/web/app/coffee/infrastructure/RedisWrapper.coffee

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