mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-18 15:09:34 +00:00
DashBoard组件相关
This commit is contained in:
6
lib/cache/cache_manager.js
vendored
6
lib/cache/cache_manager.js
vendored
@@ -10,10 +10,11 @@ import MemoryCache from './memory_cache'
|
||||
export async function getDataFromCache(key, force) {
|
||||
if (BLOG.ENABLE_CACHE || force) {
|
||||
const dataFromCache = await getApi().getCache(key)
|
||||
if (JSON.stringify(dataFromCache) === '[]') {
|
||||
if (!dataFromCache || JSON.stringify(dataFromCache) === '[]') {
|
||||
return null
|
||||
}
|
||||
return getApi().getCache(key)
|
||||
// console.trace('[API-->>缓存]:', key, dataFromCache)
|
||||
return dataFromCache
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
@@ -23,6 +24,7 @@ export async function setDataToCache(key, data) {
|
||||
if (!data) {
|
||||
return
|
||||
}
|
||||
// console.trace('[API-->>缓存写入]:', key)
|
||||
await getApi().setCache(key, data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user