fix: wrong cache key

This commit is contained in:
Henry 2022-05-13 05:42:28 +01:00
parent 6ec2ba9013
commit 659997e4cc
No known key found for this signature in database
GPG Key ID: 6A9659F995F0CDED
2 changed files with 2 additions and 2 deletions

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);

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}`,