增加搜索缓存

This commit is contained in:
2025-08-30 13:29:18 +08:00
parent 2a980c83d2
commit aa04f9d03f
5 changed files with 68 additions and 11 deletions
+3 -3
View File
@@ -58,7 +58,7 @@ class CacheConfigManager {
const configDir = path.dirname(this.configPath);
if (!require('fs').existsSync(configDir)) {
require('fs').mkdirSync(configDir, { recursive: true });
console.log('缓存配置目录创建成功:', configDir);
// console.log('缓存配置目录创建成功:', configDir);
}
} catch (error) {
console.error('创建缓存配置目录失败:', error);
@@ -72,7 +72,7 @@ class CacheConfigManager {
try {
// 检查配置文件是否存在
await fs.access(this.configPath);
console.log('缓存配置文件已存在');
// console.log('缓存配置文件已存在');
} catch (error) {
// 配置文件不存在,创建默认配置
console.log('创建默认缓存配置文件...');
@@ -87,7 +87,7 @@ class CacheConfigManager {
try {
const configContent = JSON.stringify(this.defaultConfig, null, 2);
await fs.writeFile(this.configPath, configContent, 'utf8');
console.log('默认缓存配置文件创建成功:', this.configPath);
// console.log('默认缓存配置文件创建成功:', this.configPath);
} catch (error) {
console.error('创建默认缓存配置文件失败:', error);
throw error;