mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
add null check on response
This commit is contained in:
parent
5bb3acc1eb
commit
89efa7e83e
1 changed files with 2 additions and 2 deletions
|
@ -100,7 +100,7 @@ module.exports = ClsiManager =
|
||||||
timer = new Metrics.Timer("compile.currentBackend")
|
timer = new Metrics.Timer("compile.currentBackend")
|
||||||
request opts, (err, response, body)->
|
request opts, (err, response, body)->
|
||||||
timer.done()
|
timer.done()
|
||||||
Metrics.inc "compile.currentBackend.response.#{response.statusCode}"
|
Metrics.inc "compile.currentBackend.response.#{response?.statusCode}"
|
||||||
if err?
|
if err?
|
||||||
logger.err err:err, project_id:project_id, url:opts?.url, "error making request to clsi"
|
logger.err err:err, project_id:project_id, url:opts?.url, "error making request to clsi"
|
||||||
return callback(err)
|
return callback(err)
|
||||||
|
@ -112,7 +112,7 @@ module.exports = ClsiManager =
|
||||||
newBackend: (cb)->
|
newBackend: (cb)->
|
||||||
startTime = new Date()
|
startTime = new Date()
|
||||||
ClsiManager._makeNewBackendRequest project_id, opts, (err, response, body)->
|
ClsiManager._makeNewBackendRequest project_id, opts, (err, response, body)->
|
||||||
Metrics.inc "compile.newBackend.response.#{response.statusCode}"
|
Metrics.inc "compile.newBackend.response.#{response?.statusCode}"
|
||||||
cb(err, {response:response, body:body, finishTime:new Date() - startTime})
|
cb(err, {response:response, body:body, finishTime:new Date() - startTime})
|
||||||
}, (err, results)->
|
}, (err, results)->
|
||||||
timeDifference = results.newBackend?.finishTime - results.currentBackend?.finishTime
|
timeDifference = results.newBackend?.finishTime - results.currentBackend?.finishTime
|
||||||
|
|
Loading…
Reference in a new issue