Explorar o código

Only pass through keys to redis that are explicitly set in the config

James Allen %!s(int64=10) %!d(string=hai) anos
pai
achega
39d920682a
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      services/document-updater/app/coffee/RedisBackend.coffee

+ 5 - 2
services/document-updater/app/coffee/RedisBackend.coffee

@@ -113,8 +113,11 @@ module.exports =
 				rclient = new Redis.Cluster(config.cluster)
 				driver = "ioredis"
 			else
-				{host, port, password, endpoints, masterName} = config
-				rclient = require("redis-sharelatex").createClient({host, port, password, endpoints, masterName})
+				redis_config = {}
+				for key in ["host", "port", "password", "endpoints", "masterName"]
+					if config[key]?
+						redis_config[key] = config[key]
+				rclient = require("redis-sharelatex").createClient(redis_config)
 				driver = "redis"
 			return {
 				rclient: rclient