mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-21 07:26:49 +00:00
全文搜索适配
This commit is contained in:
17
lib/cache/cache_manager.js
vendored
17
lib/cache/cache_manager.js
vendored
@@ -17,19 +17,20 @@ if (process.env.MONGO_DB_URL && process.env.MONGO_DB_NAME) {
|
||||
* @param {*} key
|
||||
* @returns
|
||||
*/
|
||||
export async function getDataFromCache(key) {
|
||||
if (!BLOG.ENABLE_CACHE) {
|
||||
export async function getDataFromCache(key, force) {
|
||||
if (BLOG.ENABLE_CACHE || force) {
|
||||
const dataFromCache = await api.getCache(key)
|
||||
if (JSON.stringify(dataFromCache) === '[]') {
|
||||
return null
|
||||
}
|
||||
return api.getCache(key)
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
const dataFromCache = await api.getCache(key)
|
||||
if (JSON.stringify(dataFromCache) === '[]') {
|
||||
return null
|
||||
}
|
||||
return api.getCache(key)
|
||||
}
|
||||
|
||||
export async function setDataToCache(key, data) {
|
||||
if (!BLOG.ENABLE_CACHE || !data) {
|
||||
if (!data) {
|
||||
return
|
||||
}
|
||||
await api.setCache(key, data)
|
||||
|
||||
Reference in New Issue
Block a user