fix: wrong cache key
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user