11
This commit is contained in:
parent
ae9a73c457
commit
a1d4a5ebc2
@ -161,7 +161,6 @@ const server = http.createServer(async (req, res) => {
|
||||
|
||||
} else {
|
||||
try {
|
||||
|
||||
// 增加 API 调用次数
|
||||
viewsInfo.apiCall++;
|
||||
const apiData = await fetchApiData(reqPath, token, sign);
|
||||
@ -221,7 +220,6 @@ const checkCacheHeaders = async (req, cacheMetaFile) => {
|
||||
// 检查缓存是否有效
|
||||
const isCacheValid = (cacheMetaFile, cacheContentFile) => {
|
||||
if (!fs.existsSync(cacheMetaFile) || !fs.existsSync(cacheContentFile)) return false;
|
||||
|
||||
const cacheData = JSON.parse(fs.readFileSync(cacheMetaFile, 'utf8'));
|
||||
return cacheData.expiration > Date.now();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user