Don't skip all threads on AP fetcher error

pull/3888/head
Chocobozzz 2021-03-10 09:39:17 +01:00
parent e5abb482c3
commit 266131e0ca
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 6 additions and 2 deletions

View File

@ -18,8 +18,12 @@ type ResolveThreadParams = {
type ResolveThreadResult = Promise<{ video: MVideoAccountLightBlacklistAllFiles, comment: MCommentOwnerVideo, commentCreated: boolean }>
async function addVideoComments (commentUrls: string[]) {
return Bluebird.map(commentUrls, commentUrl => {
return resolveThread({ url: commentUrl, isVideo: false })
return Bluebird.map(commentUrls, async commentUrl => {
try {
await resolveThread({ url: commentUrl, isVideo: false })
} catch (err) {
logger.warn('Cannot resolve thread %s.', commentUrl, { err })
}
}, { concurrency: CRAWL_REQUEST_CONCURRENCY })
}