From 9fffa7fc1bf2ec09c17ec94b8ea87c72f9858239 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Thu, 27 Feb 2020 00:39:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20change=20cache=20strategy=20of=20?= =?UTF-8?q?=E8=89=B2=E8=8A=B1=E5=A0=82=20(#4088)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/dsndsht23/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/routes/dsndsht23/index.js b/lib/routes/dsndsht23/index.js index e71ec70b19..361e922c2c 100644 --- a/lib/routes/dsndsht23/index.js +++ b/lib/routes/dsndsht23/index.js @@ -97,7 +97,7 @@ module.exports = async (ctx) => { $(images[k]).replaceWith(``); } } - const description = (postMessage.html() || '原帖已被删除').replace(/ignore_js_op/g, 'div'); + const description = (postMessage.html() || '抓取原帖失败').replace(/ignore_js_op/g, 'div'); const enclosureUrl = postMessage.find('div.blockcode li').text(); const single = { @@ -108,7 +108,9 @@ module.exports = async (ctx) => { enclosure_url: enclosureUrl, enclosure_type: 'application/x-bittorrent', }; - ctx.cache.set(itemUrl, JSON.stringify(single)); + if (description !== '抓取原帖失败') { + ctx.cache.set(itemUrl, JSON.stringify(single)); + } return Promise.resolve(single); }) );