Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((channelRecommendations) => {
received = _.size(channelRecommendations)
return Logger.debug(`Got ${received} recommendations from ${_.capitalize(channel.name)}`)
.then(() => Promise.map(channelRecommendations, (channelRecommendation) => {
const { channelRecommendationId } = channelRecommendation
return Recommendation.checkOut(channel, channelRecommendationId, channelRecommendation)
.then(({ recommendation, like, pass }) => likePassOrWait(channel, recommendation, like, pass))
.then((recommendation) => recommendation.save())
.catch(AlreadyCheckedOutEarlierError, ({ recommendation }) => {
skipped++
return recommendation.save()
})
.catch(OutOfLikesError, () => {
skipped++
})
.catch((error) => {
failed++
.catch((error) => {
Logger.error(error)
reply(Boom.badImplementation(error.message, error))
})
}
.catch((error) => Logger.error(error))
.finally(() => {
.catch((error) => {
Logger.error(error)
reply(Boom.badImplementation(error.message, error))
})
}
.catch((error) => {
Logger.error(error)
reply(Boom.badImplementation(error.message, error))
})
}
.catch((error) => {
Logger.error(error)
reply(Boom.badImplementation(error.message, error))
})
}
.catch((error) => {
Logger.error(error)
reply(Boom.badImplementation(error.message, error))
})
}
.catch((error) => {
Logger.error(error)
reply(Boom.badImplementation(error.message, error))
})
}
.catch((error) => {
Logger.error(error)
reply(Boom.badImplementation(error.message, error))
})
}
.catch((error) => Logger.error(error))