fix: wrong cache key
This commit is contained in:
parent
6ec2ba9013
commit
659997e4cc
|
|
@ -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}`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue