From 414b669a2c7178082ff34214c0fb2e5182e71d21 Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 13 Feb 2014 10:36:26 +0000 Subject: [PATCH] Point every redis connection to the new config --- services/document-updater/app.coffee | 6 ++++-- services/document-updater/app/coffee/LockManager.coffee | 2 +- services/document-updater/app/coffee/RedisManager.coffee | 2 +- .../document-updater/app/coffee/ShareJsUpdateManager.coffee | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/services/document-updater/app.coffee b/services/document-updater/app.coffee index f35b50fe30..1974169f4e 100644 --- a/services/document-updater/app.coffee +++ b/services/document-updater/app.coffee @@ -7,12 +7,14 @@ RedisManager = require('./app/js/RedisManager.js') UpdateManager = require('./app/js/UpdateManager.js') Keys = require('./app/js/RedisKeyBuilder') redis = require('redis') -rclient = redis.createClient(Settings.redis.port, Settings.redis.host) -rclient.auth(Settings.redis.password) metrics = require('./app/js/Metrics') Errors = require "./app/js/Errors" HttpController = require "./app/js/HttpController" +redisConf = Settings.redis.web +rclient = redis.createClient(redisConf.port, redisConf.host) +rclient.auth(redisConf.password) + app = express() app.configure -> app.use(express.logger(':remote-addr - [:date] - :user-agent ":method :url" :status - :response-time ms')); diff --git a/services/document-updater/app/coffee/LockManager.coffee b/services/document-updater/app/coffee/LockManager.coffee index 9a3d6cf761..97c06ad721 100644 --- a/services/document-updater/app/coffee/LockManager.coffee +++ b/services/document-updater/app/coffee/LockManager.coffee @@ -1,7 +1,7 @@ metrics = require('./Metrics') Settings = require('settings-sharelatex') redis = require('redis') -redisConf = Settings.redis?.web or Settings.redis or {host: "localhost", port: 6379} +redisConf = Settings.redis.web rclient = redis.createClient(redisConf.port, redisConf.host) rclient.auth(redisConf.password) keys = require('./RedisKeyBuilder') diff --git a/services/document-updater/app/coffee/RedisManager.coffee b/services/document-updater/app/coffee/RedisManager.coffee index 79bb06036d..b2c4c9c9d0 100644 --- a/services/document-updater/app/coffee/RedisManager.coffee +++ b/services/document-updater/app/coffee/RedisManager.coffee @@ -1,6 +1,6 @@ Settings = require('settings-sharelatex') redis = require('redis') -redisConf = Settings.redis?.web or Settings.redis or {host: "localhost", port: 6379} +redisConf = Settings.redis.web rclient = redis.createClient(redisConf.port, redisConf.host) rclient.auth(redisConf.password) async = require('async') diff --git a/services/document-updater/app/coffee/ShareJsUpdateManager.coffee b/services/document-updater/app/coffee/ShareJsUpdateManager.coffee index a5b2e88e4f..9cde95492b 100644 --- a/services/document-updater/app/coffee/ShareJsUpdateManager.coffee +++ b/services/document-updater/app/coffee/ShareJsUpdateManager.coffee @@ -8,7 +8,7 @@ Keys = require "./RedisKeyBuilder" util = require "util" redis = require('redis') -redisConf = Settings.redis?.web or Settings.redis or {host: "localhost", port: 6379} +redisConf = Settings.redis.web rclient = redis.createClient(redisConf.port, redisConf.host) rclient.auth(redisConf.password)