mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
cleaned up health check a little
This commit is contained in:
parent
b53dd50340
commit
35e0eafc95
1 changed files with 6 additions and 3 deletions
|
@ -26,18 +26,21 @@ module.exports =
|
|||
opts.json = true
|
||||
request.get opts, (err, res, body)->
|
||||
if res.statusCode != 200
|
||||
return cb("status code not 200, its #{res.statusCode}")
|
||||
e = "status code not 200 #{res.statusCode}"
|
||||
logger.err err:err, e
|
||||
return cb(e)
|
||||
|
||||
hasNotification = _.some body, (notification)->
|
||||
notification.key == notification_key and notification.user_id == user_id.toString()
|
||||
if hasNotification
|
||||
cb(null,body)
|
||||
cb(null, body)
|
||||
else
|
||||
logger.log body:body, "what is in the body"
|
||||
logger.log body:body, "got notifications response for health check"
|
||||
return cb("notification not found in response")
|
||||
]
|
||||
async.series jobs, (err, body)->
|
||||
if err?
|
||||
logger.err err:err, "error running health check"
|
||||
return callback(err)
|
||||
else
|
||||
notification_id = body[1][0]._id
|
||||
|
|
Loading…
Reference in a new issue