Merge pull request #596 from sharelatex/bg-suppress-incremental-compile-after-errors

suppress incremental compile after errors
This commit is contained in:
Brian Gough 2017-09-11 08:15:50 +01:00 committed by GitHub
commit 6d73c48c36
2 changed files with 11 additions and 4 deletions

View file

@ -129,10 +129,15 @@ module.exports = ClsiManager =
timer = new Metrics.Timer("editor.compile-getdocs-redis") timer = new Metrics.Timer("editor.compile-getdocs-redis")
ClsiManager.getContentFromDocUpdaterIfMatch project_id, project, options, (error, projectStateHash, docUpdaterDocs) -> ClsiManager.getContentFromDocUpdaterIfMatch project_id, project, options, (error, projectStateHash, docUpdaterDocs) ->
timer.done() timer.done()
return callback(error) if error? if error?
logger.log project_id: project_id, projectStateHash: projectStateHash, docs: docUpdaterDocs?, "checked project state" logger.error err: error, project_id: project_id, "error checking project state"
# note: we don't bail out when there's an error getting
# incremental files from the docupdater, we just fall back
# to a normal compile below
else
logger.log project_id: project_id, projectStateHash: projectStateHash, docs: docUpdaterDocs?, "checked project state"
# see if we can send an incremental update to the CLSI # see if we can send an incremental update to the CLSI
if docUpdaterDocs? and options.syncType isnt "full" if docUpdaterDocs? and (options.syncType isnt "full") and not error?
# Workaround: for now, always flush project to mongo on compile # Workaround: for now, always flush project to mongo on compile
# until we have automatic periodic flushing on the docupdater # until we have automatic periodic flushing on the docupdater
# side, to prevent documents staying in redis too long. # side, to prevent documents staying in redis too long.

View file

@ -105,7 +105,9 @@ define [
rootDoc_id: options.rootDocOverride_id or null rootDoc_id: options.rootDocOverride_id or null
draft: $scope.draft draft: $scope.draft
check: checkType check: checkType
incrementalCompilesEnabled: window.user?.betaProgram # use incremental compile for beta users but revert to a full
# compile if there is a server error
incrementalCompilesEnabled: window.user?.betaProgram and not $scope.pdf.error
_csrf: window.csrfToken _csrf: window.csrfToken
}, {params: params} }, {params: params}