RedisWrapper.coffee 516 B

1234567891011121314
  1. Settings = require 'settings-sharelatex'
  2. redis = require 'redis-sharelatex'
  3. # A per-feature interface to Redis,
  4. # looks up the feature in `settings.redis`
  5. # and returns an appropriate client.
  6. # Necessary because we don't want to migrate web over
  7. # to redis-cluster all at once.
  8. module.exports = Redis =
  9. # feature = 'websessions' | 'ratelimiter' | ...
  10. client: (feature) ->
  11. redisFeatureSettings = Settings.redis[feature] or Settings.redis.web
  12. rclient = redis.createClient(redisFeatureSettings)
  13. return rclient