From e67ee9fe6ca44156e48be94f10bd791c788f3a76 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Thu, 23 Dec 2021 15:02:21 +0800 Subject: [PATCH] build --- lib/cache/cache_manager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cache/cache_manager.js b/lib/cache/cache_manager.js index 030b60a3..dc978145 100644 --- a/lib/cache/cache_manager.js +++ b/lib/cache/cache_manager.js @@ -1,5 +1,5 @@ -// import { getCacheFromMemory, setCacheToMemory } from '@/lib/cache/memory_cache' -import { getCacheFromFile, setCacheToFile } from './local_file_cache' +import { getCacheFromMemory, setCacheToMemory } from '@/lib/cache/memory_cache' +// import { getCacheFromFile, setCacheToFile } from './local_file_cache' const enableCache = true // 生产环境禁用 /** @@ -11,7 +11,7 @@ export async function getDataFromCache (key) { if (!enableCache) { return null } - const dataFromCache = await getCacheFromFile(key) + const dataFromCache = await getCacheFromMemory(key) if (JSON.stringify(dataFromCache) === '[]') { return null } @@ -22,5 +22,5 @@ export async function setDataToCache (key, data) { if (!enableCache || !data) { return } - await setCacheToFile(key, data) + await setCacheToMemory(key, data) }