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:
@@ -106,10 +106,11 @@ module.exports = CompileManager =
|
||||
error = new Error("compilation")
|
||||
error.validate = "fail"
|
||||
# compile was killed by user, was a validation, or a compile which failed validation
|
||||
if error?.terminated or error?.validate
|
||||
if error?.terminated or error?.validate or error?.timedout
|
||||
OutputFileFinder.findOutputFiles resourceList, compileDir, (err, outputFiles) ->
|
||||
return callback(err) if err?
|
||||
callback(error, outputFiles) # return output files so user can check logs
|
||||
error.outputFiles = outputFiles # return output files so user can check logs
|
||||
callback(error)
|
||||
return
|
||||
# compile completed normally
|
||||
return callback(error) if error?
|
||||
|
||||
Reference in New Issue
Block a user