diff --git a/services/document-updater/app.coffee b/services/document-updater/app.coffee index e246d366e8..c7840f608a 100644 --- a/services/document-updater/app.coffee +++ b/services/document-updater/app.coffee @@ -7,13 +7,11 @@ RedisManager = require('./app/js/RedisManager') UpdateManager = require('./app/js/UpdateManager') DispatchManager = require('./app/js/DispatchManager') Keys = require('./app/js/RedisKeyBuilder') -redis = require('redis') 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) +redis = require("redis-sharelatex") +rclient = redis.createClient(Settings.redis.web) Path = require "path" Metrics = require "metrics-sharelatex" diff --git a/services/document-updater/app/coffee/DispatchManager.coffee b/services/document-updater/app/coffee/DispatchManager.coffee index afb1a5d176..6078304f2a 100644 --- a/services/document-updater/app/coffee/DispatchManager.coffee +++ b/services/document-updater/app/coffee/DispatchManager.coffee @@ -1,16 +1,14 @@ Settings = require('settings-sharelatex') logger = require('logger-sharelatex') Keys = require('./RedisKeyBuilder') -redis = require('redis') UpdateManager = require('./UpdateManager') Metrics = require('./Metrics') +redis = require("redis-sharelatex") module.exports = DispatchManager = createDispatcher: () -> - redisConf = Settings.redis.web - client = redis.createClient(redisConf.port, redisConf.host) - client.auth(redisConf.password) - + client = redis.createClient(Settings.redis.web) + worker = { client: client _waitForUpdateThenDispatchWorker: (callback = (error) ->) -> diff --git a/services/document-updater/app/coffee/LockManager.coffee b/services/document-updater/app/coffee/LockManager.coffee index a43bd84a1b..0facb8519b 100644 --- a/services/document-updater/app/coffee/LockManager.coffee +++ b/services/document-updater/app/coffee/LockManager.coffee @@ -1,9 +1,7 @@ metrics = require('./Metrics') Settings = require('settings-sharelatex') -redis = require('redis') -redisConf = Settings.redis.web -rclient = redis.createClient(redisConf.port, redisConf.host) -rclient.auth(redisConf.password) +redis = require("redis-sharelatex") +rclient = redis.createClient(Settings.redis.web) keys = require('./RedisKeyBuilder') logger = require "logger-sharelatex" diff --git a/services/document-updater/app/coffee/RedisManager.coffee b/services/document-updater/app/coffee/RedisManager.coffee index 9f3ad1bca2..6a920b42c4 100644 --- a/services/document-updater/app/coffee/RedisManager.coffee +++ b/services/document-updater/app/coffee/RedisManager.coffee @@ -1,8 +1,6 @@ Settings = require('settings-sharelatex') -redis = require('redis') -redisConf = Settings.redis.web -rclient = redis.createClient(redisConf.port, redisConf.host) -rclient.auth(redisConf.password) +redis = require("redis-sharelatex") +rclient = redis.createClient(Settings.redis.web) async = require('async') _ = require('underscore') keys = require('./RedisKeyBuilder') diff --git a/services/document-updater/app/coffee/ShareJsUpdateManager.coffee b/services/document-updater/app/coffee/ShareJsUpdateManager.coffee index 5f3cba4fbc..d842ccce2d 100644 --- a/services/document-updater/app/coffee/ShareJsUpdateManager.coffee +++ b/services/document-updater/app/coffee/ShareJsUpdateManager.coffee @@ -7,10 +7,8 @@ Keys = require "./RedisKeyBuilder" {EventEmitter} = require "events" util = require "util" -redis = require('redis') -redisConf = Settings.redis.web -rclient = redis.createClient(redisConf.port, redisConf.host) -rclient.auth(redisConf.password) +redis = require("redis-sharelatex") +rclient = redis.createClient(Settings.redis.web) ShareJsModel:: = {} util.inherits ShareJsModel, EventEmitter diff --git a/services/document-updater/package.json b/services/document-updater/package.json index d3af868c5f..29799f47c4 100644 --- a/services/document-updater/package.json +++ b/services/document-updater/package.json @@ -21,7 +21,8 @@ "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.0.0", "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.0.0", "sinon": "~1.5.2", - "mongojs": "0.9.11" + "mongojs": "0.9.11", + "redis-sharelatex": "0.0.1" }, "devDependencies": { "grunt-execute": "~0.1.5",