mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
running check in background
This commit is contained in:
parent
6c81d18627
commit
fd99887753
1 changed files with 16 additions and 6 deletions
|
@ -35,12 +35,22 @@ checkFileConvert = (callback)->
|
|||
], callback
|
||||
|
||||
|
||||
isOk = true
|
||||
|
||||
|
||||
runCheckInBackground = ->
|
||||
async.parallel [checkFileConvert, checkCanStoreFiles], (err)->
|
||||
if err?
|
||||
logger.err err:err, "Health check: error running"
|
||||
isOk = false
|
||||
else
|
||||
isOk = true
|
||||
|
||||
module.exports =
|
||||
|
||||
check: (req, res)->
|
||||
async.parallel [checkFileConvert, checkCanStoreFiles], (err)->
|
||||
if err?
|
||||
logger.err err:err, "Health check: error running"
|
||||
return res.send 500
|
||||
else
|
||||
return res.send 200
|
||||
if isOk
|
||||
res.send 200
|
||||
else
|
||||
res.send 500
|
||||
runCheckInBackground()
|
||||
|
|
Loading…
Reference in a new issue