mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-09 15:10:39 +00:00
log
This commit is contained in:
@@ -106,7 +106,7 @@ export async function getNotionPageData({ pageId, from }) {
|
|||||||
const cacheKey = 'page_block_' + pageId
|
const cacheKey = 'page_block_' + pageId
|
||||||
const data = await getDataFromCache(cacheKey)
|
const data = await getDataFromCache(cacheKey)
|
||||||
if (data && data.pageIds?.length > 0) {
|
if (data && data.pageIds?.length > 0) {
|
||||||
console.log('[API<<--缓存]', `from:${from}`, `root-page-id:${pageId}`)
|
// console.log('[API<<--缓存]', `from:${from}`, `root-page-id:${pageId}`)
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
const db = await getDataBaseInfoByNotionAPI({ pageId, from })
|
const db = await getDataBaseInfoByNotionAPI({ pageId, from })
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function getPostBlocks(id, from, slice) {
|
|||||||
const cacheKey = 'page_block_' + id
|
const cacheKey = 'page_block_' + id
|
||||||
let pageBlock = await getDataFromCache(cacheKey)
|
let pageBlock = await getDataFromCache(cacheKey)
|
||||||
if (pageBlock) {
|
if (pageBlock) {
|
||||||
console.log('[API<<--缓存]', `from:${from}`, cacheKey)
|
// console.log('[API<<--缓存]', `from:${from}`, cacheKey)
|
||||||
return filterPostBlocks(id, pageBlock, slice)
|
return filterPostBlocks(id, pageBlock, slice)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ export async function getSingleBlock(id, from) {
|
|||||||
const cacheKey = 'single_block_' + id
|
const cacheKey = 'single_block_' + id
|
||||||
let pageBlock = await getDataFromCache(cacheKey)
|
let pageBlock = await getDataFromCache(cacheKey)
|
||||||
if (pageBlock) {
|
if (pageBlock) {
|
||||||
console.log('[API<<--缓存]', `from:${from}`, cacheKey)
|
// console.log('[API<<--缓存]', `from:${from}`, cacheKey)
|
||||||
return pageBlock
|
return pageBlock
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ export async function getPageWithRetry(id, from, retryAttempts = 3) {
|
|||||||
const cacheKey = 'page_block_' + id
|
const cacheKey = 'page_block_' + id
|
||||||
const pageBlock = await getDataFromCache(cacheKey)
|
const pageBlock = await getDataFromCache(cacheKey)
|
||||||
if (pageBlock) {
|
if (pageBlock) {
|
||||||
console.log('[重试缓存]', `from:${from}`, `id:${id}`)
|
// console.log('[重试缓存]', `from:${from}`, `id:${id}`)
|
||||||
return pageBlock
|
return pageBlock
|
||||||
}
|
}
|
||||||
return await getPageWithRetry(id, from, retryAttempts - 1)
|
return await getPageWithRetry(id, from, retryAttempts - 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user