1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-08 07:11:58 +00:00

set the request timeout to a few mins for the compile

This commit is contained in:
Henry Oswald 2014-10-17 13:23:29 +01:00
parent e7906f7018
commit b9d6d5bbf1
3 changed files with 10 additions and 0 deletions
services/web
app/coffee/Features/Compile
test/UnitTests/coffee

View file

@ -10,6 +10,7 @@ UserGetter = require "../User/UserGetter"
module.exports = CompileController =
compile: (req, res, next = (error) ->) ->
res.setTimeout(5 * 60 * 1000)
project_id = req.params.Project_id
isAutoCompile = !!req.query?.auto_compile
settingsOverride = req.body?.settingsOverride ? {};

View file

@ -38,6 +38,11 @@ describe "CompileController", ->
@res = new MockResponse()
describe "compile", ->
describe "when not an auto compile", ->
beforeEach ->
@req.params =
@ -73,6 +78,8 @@ describe "CompileController", ->
@UserGetter.getUser.args[0][0].should.equal @user_id
assert.deepEqual @UserGetter.getUser.args[0][1], {"features.compileGroup":1, "features.compileTimeout":1}
it "should set the timeout", ->
assert @res.timout > 1000 * 60 * 3
describe "when an auto compile", ->
beforeEach ->

View file

@ -39,6 +39,8 @@ class MockResponse
setHeader: (header, value) ->
@headers[header] = value
setTimeout: (@timout)->
header: sinon.stub()
contentType: sinon.stub()