Merge pull request #3182 from omnivore-app/fix/importer-notification

This commit is contained in:
Hongbo Wu 2023-11-28 14:59:52 +08:00 committed by GitHub
commit d09ec51136
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -446,6 +446,7 @@ async function fetchContent(req, res) {
} catch (e) {
logRecord.error = e.message;
console.error(`Error while retrieving page`, logRecord);
statusCode = 500;
// fallback to scrapingbee for non pdf content
if (url && contentType !== 'application/pdf') {
@ -456,6 +457,7 @@ async function fetchContent(req, res) {
content = sbResult.domContent;
title = sbResult.title;
logRecord.fetchContentTime = Date.now() - fetchStartTime;
statusCode = 200;
}
} finally {
// close browser context if it was opened
@ -507,7 +509,7 @@ async function fetchContent(req, res) {
// mark import failed on the last failed retry
const retryCount = req.headers['x-cloudtasks-taskretrycount'];
if (retryCount == MAX_RETRY_COUNT) {
console.debug('max retry count reached');
console.info('max retry count reached');
importStatus = importStatus || 'failed';
}