Point every redis connection to the new config

This commit is contained in:
James Allen 2014-02-13 10:36:26 +00:00
parent a5d816272e
commit 414b669a2c
4 changed files with 7 additions and 5 deletions

View file

@ -7,12 +7,14 @@ RedisManager = require('./app/js/RedisManager.js')
UpdateManager = require('./app/js/UpdateManager.js') UpdateManager = require('./app/js/UpdateManager.js')
Keys = require('./app/js/RedisKeyBuilder') Keys = require('./app/js/RedisKeyBuilder')
redis = require('redis') redis = require('redis')
rclient = redis.createClient(Settings.redis.port, Settings.redis.host)
rclient.auth(Settings.redis.password)
metrics = require('./app/js/Metrics') metrics = require('./app/js/Metrics')
Errors = require "./app/js/Errors" Errors = require "./app/js/Errors"
HttpController = require "./app/js/HttpController" HttpController = require "./app/js/HttpController"
redisConf = Settings.redis.web
rclient = redis.createClient(redisConf.port, redisConf.host)
rclient.auth(redisConf.password)
app = express() app = express()
app.configure -> app.configure ->
app.use(express.logger(':remote-addr - [:date] - :user-agent ":method :url" :status - :response-time ms')); app.use(express.logger(':remote-addr - [:date] - :user-agent ":method :url" :status - :response-time ms'));

View file

@ -1,7 +1,7 @@
metrics = require('./Metrics') metrics = require('./Metrics')
Settings = require('settings-sharelatex') Settings = require('settings-sharelatex')
redis = require('redis') 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 = redis.createClient(redisConf.port, redisConf.host)
rclient.auth(redisConf.password) rclient.auth(redisConf.password)
keys = require('./RedisKeyBuilder') keys = require('./RedisKeyBuilder')

View file

@ -1,6 +1,6 @@
Settings = require('settings-sharelatex') Settings = require('settings-sharelatex')
redis = require('redis') 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 = redis.createClient(redisConf.port, redisConf.host)
rclient.auth(redisConf.password) rclient.auth(redisConf.password)
async = require('async') async = require('async')

View file

@ -8,7 +8,7 @@ Keys = require "./RedisKeyBuilder"
util = require "util" util = require "util"
redis = require('redis') 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 = redis.createClient(redisConf.port, redisConf.host)
rclient.auth(redisConf.password) rclient.auth(redisConf.password)