Send output files on timeout

The unconventional use of callbacks to return both an error and data
after compilation created a subtle bug where the output files were
dropped by the LockManager in case of an error such as a timeout.

This prevented the frontend to show error logs when a timeout occurs,
creating confusion among users.

We now attach the output files to the error so that they reach the
controller and are sent back to the web service.
This commit is contained in:
Eric Mc Sween
2019-10-22 15:30:14 -04:00
parent a62ff6e248
commit 775306aa63
4 changed files with 22 additions and 17 deletions

View File

@@ -15,7 +15,7 @@ describe "Timed out compile", ->
\\documentclass{article}
\\begin{document}
\\def\\x{Hello!\\par\\x}
\\x
\\x
\\end{document}
'''
]
@@ -29,3 +29,6 @@ describe "Timed out compile", ->
it "should return a timedout status", ->
@body.compile.status.should.equal "timedout"
it "should return the log output file name", ->
outputFilePaths = @body.compile.outputFiles.map((x) => x.path)
outputFilePaths.should.include('output.log')