update thumbnail if failed to fetch and return url if already signed

This commit is contained in:
Hongbo Wu
2023-08-10 18:41:03 +08:00
parent 8809c9764a
commit f06d2558c2
3 changed files with 9 additions and 8 deletions

View File

@ -346,7 +346,11 @@ export const thumbnailHandler = Sentry.GCPFunction.wrapHttpFunction(
console.log('thumbnail already set')
// pre-cache thumbnail first if exists
const imageProxyUrl = createImageProxyUrl(page.image, 320, 320)
await fetchImage(imageProxyUrl)
const image = await fetchImage(imageProxyUrl)
if (!image) {
console.log('thumbnail image not found')
page.image = undefined
}
}
console.log('pre-caching all images...')