Print files: a transient failure to load the places table is retried on the next print
loadPlaces memoised an empty table on ANY failure, so one network error meant no city dots for the rest of the session, while the other pinned loaders retry. A table that is not served (or a reader offline) is now forgotten, so a later print tries again; wrong bytes, refused after the fresh refetch, stay refused for the session.
This commit is contained in:
parent
ef439a5d8e
commit
b391988a0f
1 changed files with 5 additions and 3 deletions
|
|
@ -102,12 +102,14 @@ function loadPlaces(assetsBase) {
|
|||
let text
|
||||
try { text = await fetchPinned(url, NE_PLACES_SHA384) }
|
||||
catch (e) {
|
||||
if (e?.integrity) console.warn(`[posterSheets] ${url} failed its integrity check, also when fetched fresh — drawing no city dots`)
|
||||
if (!e?.integrity) throw e // not served, or offline: a later print tries again (below)
|
||||
console.warn(`[posterSheets] ${url} failed its integrity check, also when fetched fresh — drawing no city dots`)
|
||||
return []
|
||||
}
|
||||
return JSON.parse(text).places || []
|
||||
})().catch(() => [])
|
||||
placesCache.set(url, p)
|
||||
})()
|
||||
// Wrong bytes stay refused for the session; a transient failure is forgotten, as in the other loaders.
|
||||
placesCache.set(url, p.catch(() => { placesCache.delete(url); return [] }))
|
||||
}
|
||||
return placesCache.get(url)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue