mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-15 05:06:30 +00:00
Don't automatically clear the cache
This commit is contained in:
parent
10c012d856
commit
8f41c6dcb2
4 changed files with 11 additions and 29 deletions
|
@ -31,13 +31,7 @@ module.exports = CompileManager =
|
|||
DocumentUpdaterHandler.flushProjectToMongo project_id, (error) ->
|
||||
return callback(error) if error?
|
||||
ClsiManager.sendRequest project_id, (error, status, outputFiles) ->
|
||||
if error?
|
||||
# Sometimes compiles error because the project gets in a broken
|
||||
# state in the CLSI. So always clear cache on an error.
|
||||
# Can do this in the background.
|
||||
ClsiManager.deleteAuxFiles project_id
|
||||
return callback(error)
|
||||
|
||||
return callback(error) if error?
|
||||
logger.log files: outputFiles, "output files"
|
||||
callback(null, status, outputFiles)
|
||||
|
||||
|
|
|
@ -234,9 +234,13 @@
|
|||
|
||||
script(type="text/template")#compileErrorTemplate
|
||||
li.alert.alert-error
|
||||
strong Server Error.
|
||||
span Sorry, something went wrong and the project could not be compiled. Please try again in a few moments and if the problem continues please contact support.
|
||||
|
||||
p
|
||||
strong Server Error.
|
||||
span Sorry, something went wrong and the project could not be compiled. Please try again in a few moments.
|
||||
p
|
||||
| If the problem persists, try
|
||||
a(href='#').js-clear-cache clearing the cache.
|
||||
| If that doesn't work, please contact support.
|
||||
script(type="text/template")#compileFailedTemplate
|
||||
li.alert.alert-error
|
||||
p
|
||||
|
|
|
@ -117,10 +117,11 @@ define [
|
|||
errorLogs.prepend($(@templates.compileError))
|
||||
else if !pdfExists
|
||||
errorLogs.prepend($(@templates.compileFailed))
|
||||
errorLogs.find(".js-clear-cache").on "click", () =>
|
||||
@options.manager.deleteCachedFiles()
|
||||
else if pdfExists && compileErrors.all.length == 0
|
||||
errorLogs.prepend($(@templates.compileSuccess))
|
||||
|
||||
errorLogs.find(".js-clear-cache").on "click", () =>
|
||||
@options.manager.deleteCachedFiles()
|
||||
|
||||
@$("#rawLogArea").find("pre").text(rawLog)
|
||||
|
||||
|
|
|
@ -75,23 +75,6 @@ describe "CompileManager", ->
|
|||
@logger.log
|
||||
.calledWith(project_id: @project_id, user_id: @user_id, "compiling project")
|
||||
.should.equal true
|
||||
|
||||
describe "when the compile errors", ->
|
||||
beforeEach ->
|
||||
@CompileManager._checkIfAutoCompileLimitHasBeenHit = (_, cb)-> cb(null, true)
|
||||
@ClsiManager.deleteAuxFiles = sinon.stub()
|
||||
@ClsiManager.sendRequest = sinon.stub().callsArgWith(1, @error = new Error("oops"), @status = "failure")
|
||||
@CompileManager.compile @project_id, @user_id, {}, @callback
|
||||
|
||||
it "should call the callback with the error", ->
|
||||
@callback
|
||||
.calledWith(@error)
|
||||
.should.equal true
|
||||
|
||||
it "should clear the CLSI cache", ->
|
||||
@ClsiManager.deleteAuxFiles
|
||||
.calledWith(@project_id)
|
||||
.should.equal true
|
||||
|
||||
describe "when the project has been recently compiled", ->
|
||||
beforeEach ->
|
||||
|
|
Loading…
Add table
Reference in a new issue