From 659997e4cc180e82bc2472e3abc70dd510baa406 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 13 May 2022 05:42:28 +0100 Subject: [PATCH] fix: wrong cache key --- lib/v2/apple/exchange_repair.js | 2 +- lib/v2/gf-cn/news.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/v2/apple/exchange_repair.js b/lib/v2/apple/exchange_repair.js index 7ed1f4c79..fd875a3e2 100644 --- a/lib/v2/apple/exchange_repair.js +++ b/lib/v2/apple/exchange_repair.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { list.map((item) => { const $ = cheerio.load(item); const $a = $('.icon-chevronright').parent(); - const itemUrl = new URL($a.attr('href'), host); + const itemUrl = new URL($a.attr('href'), host).href; return ctx.cache.tryGet(itemUrl, async () => { const response = await got.get(itemUrl); diff --git a/lib/v2/gf-cn/news.js b/lib/v2/gf-cn/news.js index a6e2d9722..e69a206e9 100644 --- a/lib/v2/gf-cn/news.js +++ b/lib/v2/gf-cn/news.js @@ -29,7 +29,7 @@ module.exports = async (ctx) => { items = await Promise.all( items.map((item) => - ctx.cache.tryGet(item.guid, async () => { + ctx.cache.tryGet(item.link, async () => { const detailResponse = await got({ method: 'get', url: `${apiRootUrl}/website/news/${item.guid}`,