From 8aa77cec5e4da4e6093a9a688e28e5daae0e24e7 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 8 Aug 2017 16:48:47 +0100 Subject: [PATCH] provide fallback to normal compile method --- .../Features/Compile/ClsiManager.coffee | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/services/web/app/coffee/Features/Compile/ClsiManager.coffee b/services/web/app/coffee/Features/Compile/ClsiManager.coffee index 40617f23f8..2f46a35d11 100755 --- a/services/web/app/coffee/Features/Compile/ClsiManager.coffee +++ b/services/web/app/coffee/Features/Compile/ClsiManager.coffee @@ -124,14 +124,19 @@ module.exports = ClsiManager = if project.compiler not in ClsiManager.VALID_COMPILERS project.compiler = "pdflatex" - ClsiManager.getContentFromDocUpdaterIfMatch project_id, project, (error, projectStateHash, docUpdaterDocs) -> - return callback(error) if error? - logger.log project_id: project_id, projectStateHash: projectStateHash, docs: docUpdaterDocs?, "checked project state" - # see if we can send an incremental update to the CLSI - if docUpdaterDocs? and options.syncType isnt "full" - ClsiManager._buildRequestFromDocupdater project_id, options, project, projectStateHash, docUpdaterDocs, callback - else - ClsiManager._buildRequestFromMongo project_id, options, project, projectStateHash, callback + if options.syncType? # new way, either incremental or full + ClsiManager.getContentFromDocUpdaterIfMatch project_id, project, (error, projectStateHash, docUpdaterDocs) -> + return callback(error) if error? + logger.log project_id: project_id, projectStateHash: projectStateHash, docs: docUpdaterDocs?, "checked project state" + # see if we can send an incremental update to the CLSI + if docUpdaterDocs? and options.syncType isnt "full" + ClsiManager._buildRequestFromDocupdater project_id, options, project, projectStateHash, docUpdaterDocs, callback + else + ClsiManager._buildRequestFromMongo project_id, options, project, projectStateHash, callback + else # old way, always from mongo + ClsiManager._getContentFromMongo project_id, (error, docs, files) -> + return callback(error) if error? + ClsiManager._finaliseRequest project_id, options, project, docs, files, callback getContentFromDocUpdaterIfMatch: (project_id, project, callback = (error, projectStateHash, docs) ->) -> ClsiStateManager.computeHash project, (error, projectStateHash) ->