|
|
@@ -133,16 +133,20 @@ if Settings.forceDrainMsDelay?
|
|
|
if Settings.continualPubsubTraffic
|
|
|
console.log "continualPubsubTraffic enabled"
|
|
|
|
|
|
- pubSubClient = redis.createClient(Settings.redis.documentupdater)
|
|
|
+ redisClients = [redis.createClient(Settings.redis.documentupdater), redis.createClient(Settings.redis.realtime)]
|
|
|
|
|
|
- publishJob = (channel, cb)->
|
|
|
+ publishJob = (channel, callback)->
|
|
|
checker = new HealthCheckManager(channel)
|
|
|
logger.debug {channel:channel}, "sending pub to keep connection alive"
|
|
|
json = JSON.stringify({health_check:true, key: checker.id, date: new Date().toString()})
|
|
|
- pubSubClient.publish channel, json, (err)->
|
|
|
- if err?
|
|
|
- logger.err {err, channel}, "error publishing pubsub traffic to redis"
|
|
|
- cb(err)
|
|
|
+ jobs = _.map redisClients, (rclient)->
|
|
|
+ return (cb)->
|
|
|
+ rclient.publish channel, json, (err)->
|
|
|
+ if err?
|
|
|
+ logger.err {err, channel}, "error publishing pubsub traffic to redis"
|
|
|
+ return cb(err)
|
|
|
+
|
|
|
+ async.series jobs, callback
|
|
|
|
|
|
runPubSubTraffic = ->
|
|
|
async.map ["applied-ops", "editor-events"], publishJob, (err)->
|