move start time inside each clsi request as they are run in series now

This commit is contained in:
Henry Oswald 2018-06-20 14:15:42 +01:00
parent 5a7b8f4887
commit 4cb78a5797

View file

@ -89,9 +89,9 @@ module.exports = ClsiManager =
callback(null, response?.compile?.status, outputFiles, clsiServerId) callback(null, response?.compile?.status, outputFiles, clsiServerId)
_makeRequest: (project_id, opts, callback)-> _makeRequest: (project_id, opts, callback)->
startTime = new Date()
async.series { async.series {
currentBackend: (cb)-> currentBackend: (cb)->
startTime = new Date()
ClsiCookieManager.getCookieJar project_id, (err, jar)-> ClsiCookieManager.getCookieJar project_id, (err, jar)->
if err? if err?
logger.err err:err, "error getting cookie jar for clsi request" logger.err err:err, "error getting cookie jar for clsi request"
@ -109,6 +109,7 @@ module.exports = ClsiManager =
callback err, response, body #return as soon as the standard compile has returned callback err, response, body #return as soon as the standard compile has returned
cb(err, {response:response, body:body, finishTime:new Date() - startTime }) cb(err, {response:response, body:body, finishTime:new Date() - startTime })
newBackend: (cb)-> newBackend: (cb)->
startTime = new Date()
ClsiManager._makeNewBackendRequest project_id, opts, (err, response, body)-> ClsiManager._makeNewBackendRequest project_id, opts, (err, response, body)->
cb(err, {response:response, body:body, finishTime:new Date() - startTime}) cb(err, {response:response, body:body, finishTime:new Date() - startTime})
}, (err, results)-> }, (err, results)->