缓存优化

This commit is contained in:
tangly1024
2022-01-27 13:58:49 +08:00
parent 44c698fd4d
commit 63e39fa2a8
6 changed files with 26 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ import getAllPageIds from './getAllPageIds'
import getPageProperties from './getPageProperties'
import { defaultMapImageUrl } from 'react-notion-x'
import { getNotionPageData } from '@/lib/notion/getNotionData'
import { delCacheData } from '@/lib/cache/cache_manager'
/**
* 获取所有文章列表
@@ -61,6 +62,8 @@ export async function getAllPosts ({ notionPageData, from, includePage = false }
if (!posts || posts.length === 0) {
console.warn('文章列表为空')
const cacheKey = 'page_block_' + BLOG.NOTION_PAGE_ID
await delCacheData(cacheKey)
}
// Sort by date
if (BLOG.POSTS_SORT_BY === 'date') {