diff --git a/lib/v2/firefox/index.js b/lib/v2/firefox/index.js index 7809c5760f..fce9536b23 100644 --- a/lib/v2/firefox/index.js +++ b/lib/v2/firefox/index.js @@ -27,23 +27,27 @@ module.exports = async (ctx) => { const items = await Promise.all( list && list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const article = await got({ - url: item.link, - header: { - Referer: baseUrl + '/breaches', - }, - }); - const content = cheerio.load(article.body); + ctx.cache.tryGet( + item.link, + async () => { + const article = await got({ + url: item.link, + header: { + Referer: baseUrl + '/breaches', + }, + }); + const content = cheerio.load(article.body); - item.description = art(path.join(__dirname, 'templates/description.art'), { - header: content('#breach-detail').html(), - overview: content('section.detail-section.jst-cntr.flx.flx-col').html(), - dataClasses: content('section.detail-section.bg-white.jst-cntr.flx.flx-col').html(), - }); + item.description = art(path.join(__dirname, 'templates/description.art'), { + header: content('#breach-detail').html(), + overview: content('section.detail-section.jst-cntr.flx.flx-col').html(), + dataClasses: content('section.detail-section.bg-white.jst-cntr.flx.flx-col').html(), + }); - return item; - }, 31536000) + return item; + }, + 31536000 + ) ) );