From 0f855689a7c6c4b7d5f1a8a0aeefecfb41ba2c1c Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 26 Sep 2017 08:07:35 +0100 Subject: [PATCH] show error for compile in progress --- services/web/app/coffee/Features/Compile/ClsiManager.coffee | 2 ++ services/web/app/views/project/editor/pdf.pug | 4 ++++ .../public/coffee/ide/pdf/controllers/PdfController.coffee | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/services/web/app/coffee/Features/Compile/ClsiManager.coffee b/services/web/app/coffee/Features/Compile/ClsiManager.coffee index 68b13a8f68..46cb4e35e3 100755 --- a/services/web/app/coffee/Features/Compile/ClsiManager.coffee +++ b/services/web/app/coffee/Features/Compile/ClsiManager.coffee @@ -107,6 +107,8 @@ module.exports = ClsiManager = callback null, compile:status:"project-too-large" else if response.statusCode == 409 callback null, compile:status:"conflict" + else if response.statusCode == 423 + callback null, compile:status:"compile-in-progress" else error = new Error("CLSI returned non-success code: #{response.statusCode}") logger.error err: error, project_id: project_id, "CLSI returned failure code" diff --git a/services/web/app/views/project/editor/pdf.pug b/services/web/app/views/project/editor/pdf.pug index db4a0e9dd3..065dd0cec0 100644 --- a/services/web/app/views/project/editor/pdf.pug +++ b/services/web/app/views/project/editor/pdf.pug @@ -344,6 +344,10 @@ div.full-size.pdf(ng-controller="PdfController") strong #{translate("pdf_compile_rate_limit_hit")} span #{translate("project_flagged_too_many_compiles")} + .alert.alert-danger(ng-show="pdf.compileInProgress") + strong #{translate("pdf_compile_in_progress_error")} + span #{translate("pdf_compile_try_again")} + .alert.alert-danger(ng-show="pdf.timedout") p strong #{translate("timedout")}. diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index ce3c8cbce1..ed69ee63f7 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -167,6 +167,7 @@ define [ $scope.pdf.compileTerminated = false $scope.pdf.compileExited = false $scope.pdf.failedCheck = false + $scope.pdf.compileInProgress = false # make a cache to look up files by name fileByPath = {} @@ -223,6 +224,9 @@ define [ else if response.status == "validation-problems" $scope.pdf.view = "validation-problems" $scope.pdf.validation = response.validationProblems + else if response.status == "compile-in-progress" + $scope.pdf.view = 'errors' + $scope.pdf.compileInProgress = true else if response.status == "success" $scope.pdf.view = 'pdf' $scope.shouldShowLogs = false