From bd5ea562db6187c44d4a01660604c5982b6dceb4 Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Wed, 26 Sep 2018 04:15:14 +0100 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=87=82=E7=90=83=E5=B8=9D?= =?UTF-8?q?=E7=BC=93=E5=AD=98=20(#797)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close #792 懂球帝在国外访问非常慢,经常超时。设置太长的缓存可能导致无法刷新。 --- routes/dongqiudi/daily.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/routes/dongqiudi/daily.js b/routes/dongqiudi/daily.js index 4eebb42fb..cc6050b1d 100644 --- a/routes/dongqiudi/daily.js +++ b/routes/dongqiudi/daily.js @@ -19,14 +19,10 @@ module.exports = async (ctx) => { const $ = cheerio.load(item); const title = $('a').text(); const itemUrl = host + $('a').attr('href'); - const cache = await ctx.cache.get(itemUrl); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } + const single = { title, link: itemUrl, - guid: itemUrl, }; try { @@ -47,7 +43,6 @@ module.exports = async (ctx) => { out[i].description = full.find('div:nth-of-type(1)').html(); out[i].author = full.find('span.name').text(); out[i].pubDate = new Date(full.find('span.time').text()).toUTCString(); - ctx.cache.set(out[i].link, JSON.stringify(out[i]), 24 * 60 * 60); } ctx.state.data = { title: '懂球帝早报',