1
0
Fork 0

Don't skip all threads on AP fetcher error

This commit is contained in:
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

View file

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