mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 02:00:10 +02: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:
@@ -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++
|
||||
|
||||
Reference in New Issue
Block a user