mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-05 07:26:46 +00:00
perf(使用缓存优化): 复杂的数据转换函数使用缓存优化
This commit is contained in:
@@ -66,13 +66,14 @@ export async function getGlobalData({
|
||||
*/
|
||||
export async function getSiteDataByPageId({ pageId, from }) {
|
||||
// 获取NOTION原始数据,此接支持mem缓存。
|
||||
const pageRecordMap = await getPage(pageId, from)
|
||||
return await getOrSetDataWithCache(
|
||||
`site_data_${pageId}`,
|
||||
converNotionToSiteDate,
|
||||
async (pageId, from) => {
|
||||
const pageRecordMap = await getPage(pageId, from)
|
||||
return converNotionToSiteDate(pageId, from, deepClone(pageRecordMap))
|
||||
},
|
||||
pageId,
|
||||
from,
|
||||
deepClone(pageRecordMap)
|
||||
from
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user