mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #13980 from overleaf/mj-web-compile-timeout
[web] Add timeout for compile requests to clsi GitOrigin-RevId: 94d6de60eec1fc9e52971e14f38f2d4aef6b7f5d
This commit is contained in:
parent
42cffc8862
commit
c7006fabd4
2 changed files with 7 additions and 0 deletions
|
@ -29,6 +29,9 @@ const VALID_COMPILERS = ['pdflatex', 'latex', 'xelatex', 'lualatex']
|
|||
const OUTPUT_FILE_TIMEOUT_MS = 60000
|
||||
const CLSI_COOKIES_ENABLED = (Settings.clsiCookie?.key ?? '') !== ''
|
||||
|
||||
// The timeout in services/clsi/app.js is 10 minutes, so we'll be on the safe side with 12 minutes
|
||||
const COMPILE_REQUEST_TIMEOUT_MS = 12 * 60 * 1000
|
||||
|
||||
function collectMetricsOnBlgFiles(outputFiles) {
|
||||
let topLevel = 0
|
||||
let nested = 0
|
||||
|
@ -451,6 +454,7 @@ async function _postToClsi(
|
|||
const opts = {
|
||||
json: req,
|
||||
method: 'POST',
|
||||
signal: AbortSignal.timeout(COMPILE_REQUEST_TIMEOUT_MS),
|
||||
}
|
||||
try {
|
||||
const { body, clsiServerId } = await _makeRequest(
|
||||
|
|
|
@ -222,6 +222,7 @@ describe('ClsiManager', function () {
|
|||
'Content-Type': 'application/json',
|
||||
Cookie: `${this.clsiCookieKey}=${this.clsiServerId}`,
|
||||
},
|
||||
signal: sinon.match.instanceOf(AbortSignal),
|
||||
}
|
||||
)
|
||||
})
|
||||
|
@ -426,6 +427,7 @@ describe('ClsiManager', function () {
|
|||
'Content-Type': 'application/json',
|
||||
Cookie: `${this.clsiCookieKey}=${this.clsiServerId}`,
|
||||
},
|
||||
signal: sinon.match.instanceOf(AbortSignal),
|
||||
}
|
||||
)
|
||||
})
|
||||
|
@ -829,6 +831,7 @@ describe('ClsiManager', function () {
|
|||
'Content-Type': 'application/json',
|
||||
Cookie: `${this.clsiCookieKey}=${this.clsiServerId}`,
|
||||
},
|
||||
signal: sinon.match.instanceOf(AbortSignal),
|
||||
}
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue