Skip to content

Commit

Permalink
日志调整
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed May 9, 2022
1 parent f219046 commit d200420
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/notion/getPostBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function getPostBlocks(id, from, slice) {
*/
async function getPageWithRetry(id, from, retryAttempts = 3) {
if (retryAttempts && retryAttempts > 0) {
console.error('[发起请求]', `from:${from}`, `id:${id}`, `剩余重试次数:${retryAttempts}`)
console.log('[发起请求]', `from:${from}`, `id:${id}`, `剩余重试次数:${retryAttempts}`)
try {
const authToken = BLOG.NOTION_ACCESS_TOKEN || null
const api = new NotionAPI({ authToken })
Expand All @@ -39,7 +39,7 @@ async function getPageWithRetry(id, from, retryAttempts = 3) {
const cacheKey = 'page_block_' + id
const pageBlock = await getDataFromCache(cacheKey)
if (pageBlock) {
console.error('[重试获取缓存]', `from:${from}`, `id:${id}`)
console.log('[重试获取缓存]', `from:${from}`, `id:${id}`)
return pageBlock
}
return await getPageWithRetry(id, from, retryAttempts - 1)
Expand Down

0 comments on commit d200420

Please sign in to comment.