Merge pull request #17 from sharelatex/bg-lock-compiles

show error for compile in progress
This commit is contained in:
Brian Gough 2017-09-27 13:54:16 +01:00 committed by GitHub
commit 13628f82ec
3 changed files with 10 additions and 0 deletions

View file

@ -107,6 +107,8 @@ module.exports = ClsiManager =
callback null, compile:status:"project-too-large" callback null, compile:status:"project-too-large"
else if response.statusCode == 409 else if response.statusCode == 409
callback null, compile:status:"conflict" callback null, compile:status:"conflict"
else if response.statusCode == 423
callback null, compile:status:"compile-in-progress"
else else
error = new Error("CLSI returned non-success code: #{response.statusCode}") error = new Error("CLSI returned non-success code: #{response.statusCode}")
logger.error err: error, project_id: project_id, "CLSI returned failure code" logger.error err: error, project_id: project_id, "CLSI returned failure code"

View file

@ -344,6 +344,10 @@ div.full-size.pdf(ng-controller="PdfController")
strong #{translate("pdf_compile_rate_limit_hit")} strong #{translate("pdf_compile_rate_limit_hit")}
span #{translate("project_flagged_too_many_compiles")} 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") .alert.alert-danger(ng-show="pdf.timedout")
p p
strong #{translate("timedout")}. strong #{translate("timedout")}.

View file

@ -167,6 +167,7 @@ define [
$scope.pdf.compileTerminated = false $scope.pdf.compileTerminated = false
$scope.pdf.compileExited = false $scope.pdf.compileExited = false
$scope.pdf.failedCheck = false $scope.pdf.failedCheck = false
$scope.pdf.compileInProgress = false
# make a cache to look up files by name # make a cache to look up files by name
fileByPath = {} fileByPath = {}
@ -223,6 +224,9 @@ define [
else if response.status == "validation-problems" else if response.status == "validation-problems"
$scope.pdf.view = "validation-problems" $scope.pdf.view = "validation-problems"
$scope.pdf.validation = response.validationProblems $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" else if response.status == "success"
$scope.pdf.view = 'pdf' $scope.pdf.view = 'pdf'
$scope.shouldShowLogs = false $scope.shouldShowLogs = false