修复映射Notion数据库字段

This commit is contained in:
tangly
2022-10-17 22:07:51 +08:00
parent 07d48ae632
commit 96d1a85a93
4 changed files with 28 additions and 18 deletions

View File

@@ -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)