fix 掘金没有判断否抓取全文 (#1600)

* update bug report template

* fix 掘金没有判断否抓取全文
This commit is contained in:
Chenyang Shi
2019-02-22 14:57:57 +08:00
committed by DIYgod
parent d605c7f17c
commit 8e54b7cc76

View File

@@ -40,12 +40,15 @@ const ProcessFeed = async (list, caches) =>
guid: item.originalUrl,
};
// 使用tryGet方法从缓存获取内容。
// 当缓存中无法获取到链接内容的时候则使用load方法加载文章内容。
const other = await caches.tryGet(item.originalUrl, async () => await load(item.originalUrl));
// 合并解析后的结果集作为该篇文章最终的输出结果
return Promise.resolve(Object.assign({}, single, other));
if (item.type === 'post') {
// 使用tryGet方法从缓存获取内容。
// 当缓存中无法获取到链接内容的时候则使用load方法加载文章内容。
const other = await caches.tryGet(item.originalUrl, async () => await load(item.originalUrl));
// 合并解析后的结果集作为该篇文章最终的输出结果
return Promise.resolve(Object.assign({}, single, other));
} else {
return Promise.resolve(single);
}
})
);