mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-25 22:33:06 +00:00
run health check max 1 a at a time
This commit is contained in:
parent
fd99887753
commit
bf93fc3f50
1 changed files with 6 additions and 3 deletions
|
@ -25,7 +25,6 @@ checkCanStoreFiles = (callback)->
|
|||
|
||||
checkFileConvert = (callback)->
|
||||
imgPath = path.join(settings.path.uploadFolder, "/tiny.pdf")
|
||||
console.log imgPath, settings.path.uploadFolder
|
||||
async.waterfall [
|
||||
(cb)->
|
||||
fs.copy("./tiny.pdf", imgPath, cb)
|
||||
|
@ -37,14 +36,18 @@ checkFileConvert = (callback)->
|
|||
|
||||
isOk = true
|
||||
|
||||
q = async.queue (task, callback)->
|
||||
task(callback)
|
||||
|
||||
runCheckInBackground = ->
|
||||
|
||||
runChecks = (callback)->
|
||||
async.parallel [checkFileConvert, checkCanStoreFiles], (err)->
|
||||
if err?
|
||||
logger.err err:err, "Health check: error running"
|
||||
isOk = false
|
||||
else
|
||||
isOk = true
|
||||
callback()
|
||||
|
||||
module.exports =
|
||||
|
||||
|
@ -53,4 +56,4 @@ module.exports =
|
|||
res.send 200
|
||||
else
|
||||
res.send 500
|
||||
runCheckInBackground()
|
||||
q.push runChecks # run in background 1 at a time
|
||||
|
|
Loading…
Reference in a new issue