mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-27 09:42:00 +00:00
Merge pull request #10376 from overleaf/jpa-pdf-caching-disable-first-error
[web] pdf-caching: disable pdf-caching after the first non-404 error GitOrigin-RevId: f022e75acd9d5140ae02041b60af9819baa25e62
This commit is contained in:
parent
aeade59677
commit
f803563673
1 changed files with 7 additions and 0 deletions
|
@ -111,6 +111,13 @@ export function generatePdfCachingTransportFactory(PDFJS) {
|
|||
.catch(err => {
|
||||
if (abortSignal.aborted) return
|
||||
if (isExpectedError(err)) {
|
||||
if (is404(err)) {
|
||||
// A regular pdf-js request would have seen this 404 as well.
|
||||
} else {
|
||||
// Flaky network, switch back to regular pdf-js requests.
|
||||
metrics.failedCount++
|
||||
metrics.failedOnce = true
|
||||
}
|
||||
throw new PDFJS.MissingPDFException()
|
||||
}
|
||||
metrics.failedCount++
|
||||
|
|
Loading…
Reference in a new issue