fix: wrong cache key

This commit is contained in:
Henry
2022-05-13 05:42:36 +01:00
parent 6ec2ba9013
commit 659997e4cc
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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}`,