mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
修复映射Notion数据库字段
This commit is contained in:
8
lib/cache/cache_manager.js
vendored
8
lib/cache/cache_manager.js
vendored
@@ -1,7 +1,7 @@
|
||||
import MemoryCache from './memory_cache'
|
||||
import FileCache from './local_file_cache'
|
||||
import MongoCache from './mongo_db_cache'
|
||||
const enableCache = true
|
||||
import BLOG from '@/blog.config'
|
||||
|
||||
let api
|
||||
if (process.env.MONGO_DB_URL && process.env.MONGO_DB_NAME) {
|
||||
@@ -18,7 +18,7 @@ if (process.env.MONGO_DB_URL && process.env.MONGO_DB_NAME) {
|
||||
* @returns
|
||||
*/
|
||||
export async function getDataFromCache(key) {
|
||||
if (!enableCache) {
|
||||
if (!BLOG.ENABLE_CACHE) {
|
||||
return null
|
||||
}
|
||||
const dataFromCache = await api.getCache(key)
|
||||
@@ -29,14 +29,14 @@ export async function getDataFromCache(key) {
|
||||
}
|
||||
|
||||
export async function setDataToCache(key, data) {
|
||||
if (!enableCache || !data) {
|
||||
if (!BLOG.ENABLE_CACHE || !data) {
|
||||
return
|
||||
}
|
||||
await api.setCache(key, data)
|
||||
}
|
||||
|
||||
export async function delCacheData(key) {
|
||||
if (!enableCache) {
|
||||
if (!BLOG.ENABLE_CACHE) {
|
||||
return
|
||||
}
|
||||
await api.delCache(key)
|
||||
|
||||
Reference in New Issue
Block a user