搜索、缓存 、页面

This commit is contained in:
tangly1024
2022-04-13 13:42:09 +08:00
parent f1a29575bd
commit 52e707ced3
5 changed files with 13 additions and 11 deletions

View File

@@ -3,14 +3,14 @@ import BLOG from 'blog.config'
const cacheTime = BLOG.isProd ? 10 * 60 : 120 * 60 // 120 minutes for dev,10 minutes for prod
export async function getCacheFromMemory (key, options) {
return cache.get(key)
export async function getCacheFromMemory(key, options) {
return await cache.get(key)
}
export async function setCacheToMemory (key, data) {
export async function setCacheToMemory(key, data) {
await cache.put(key, data, cacheTime * 1000)
}
export async function delCacheFromMemory (key) {
export async function delCacheFromMemory(key) {
await cache.del(key)
}