目录组件百分比进度
This commit is contained in:
tangly1024
2021-12-22 16:22:17 +08:00
parent 0ef9da886f
commit 565b3ac194
9 changed files with 33 additions and 23 deletions

View File

@@ -1,4 +1,5 @@
import { getCacheFromMemory, setCacheToMemory } from '@/lib/cache/memory_cache'
// import { getCacheFromMemory, setCacheToMemory } from '@/lib/cache/memory_cache'
import { getCacheFromFile, setCacheToFile } from './local_file_cache'
const enableCache = true // 生产环境禁用
/**
@@ -10,7 +11,7 @@ export async function getDataFromCache (key) {
if (!enableCache) {
return null
}
const dataFromCache = await getCacheFromMemory(key)
const dataFromCache = await getCacheFromFile(key)
if (JSON.stringify(dataFromCache) === '[]') {
return null
}
@@ -21,5 +22,5 @@ export async function setDataToCache (key, data) {
if (!enableCache || !data) {
return
}
await setCacheToMemory(key, data)
await setCacheToFile(key, data)
}