Add in redis health check

This commit is contained in:
James Allen 2014-11-20 16:56:09 +00:00
parent 4d691cf543
commit 2a05045600
3 changed files with 11 additions and 4 deletions

View file

@ -38,6 +38,16 @@ io.configure ->
#io.enable('browser client gzip') #io.enable('browser client gzip')
io.set('transports', ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling']) io.set('transports', ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling'])
io.set('log level', 1) io.set('log level', 1)
app.get "/status", (req, res, next) ->
res.send "real-time-sharelatex is alive"
redisCheck = redis.activeHealthCheckRedis(Settings.redis.web)
app.get "/health_check/redis", (req, res, next) ->
if redisCheck.isAlive()
res.send 200
else
res.send 500
Router = require "./app/js/Router" Router = require "./app/js/Router"
Router.configure(app, io, sessionSockets) Router.configure(app, io, sessionSockets)

View file

@ -20,9 +20,6 @@ module.exports = Router =
app.get "/clients", HttpController.getConnectedClients app.get "/clients", HttpController.getConnectedClients
app.get "/clients/:client_id", HttpController.getConnectedClient app.get "/clients/:client_id", HttpController.getConnectedClient
app.get "/status", (req, res, next) ->
res.send "real-time-sharelatex is alive"
session.on 'connection', (error, client, session) -> session.on 'connection', (error, client, session) ->
if error? if error?
logger.err err: error, "error when client connected" logger.err err: error, "error when client connected"

View file

@ -15,7 +15,7 @@
"express-session": "^1.9.1", "express-session": "^1.9.1",
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.0.0", "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", "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.0.0",
"redis-sharelatex": "~0.0.4", "redis-sharelatex": "0.0.9",
"session.socket.io": "^0.1.6", "session.socket.io": "^0.1.6",
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0", "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
"socket.io": "0.9.16", "socket.io": "0.9.16",