mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-04 23:16:53 +00:00
日志调整
This commit is contained in:
@@ -29,7 +29,7 @@ export async function getPostBlocks(id, from, slice) {
|
|||||||
*/
|
*/
|
||||||
async function getPageWithRetry(id, from, retryAttempts = 3) {
|
async function getPageWithRetry(id, from, retryAttempts = 3) {
|
||||||
if (retryAttempts && retryAttempts > 0) {
|
if (retryAttempts && retryAttempts > 0) {
|
||||||
console.error('[发起请求]', `from:${from}`, `id:${id}`, `剩余重试次数:${retryAttempts}`)
|
console.log('[发起请求]', `from:${from}`, `id:${id}`, `剩余重试次数:${retryAttempts}`)
|
||||||
try {
|
try {
|
||||||
const authToken = BLOG.NOTION_ACCESS_TOKEN || null
|
const authToken = BLOG.NOTION_ACCESS_TOKEN || null
|
||||||
const api = new NotionAPI({ authToken })
|
const api = new NotionAPI({ authToken })
|
||||||
@@ -39,7 +39,7 @@ 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.error('[重试获取缓存]', `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