This commit is contained in:
jonathang4 2025-08-28 19:13:54 +08:00
parent 497cc19484
commit 5c9a5eb8ba

View File

@ -23,9 +23,13 @@ class NeDBManager {
} }
public async initialize(): Promise<void> { public async initialize(): Promise<void> {
// 如果已经初始化,直接返回
if (this.isInitialized) {
return;
}
try { try {
// 确保数据目录存在 // 确保数据目录存在
// 确保目录存在
if (!fs.existsSync(this.dataDir)) { if (!fs.existsSync(this.dataDir)) {
fs.mkdirSync(this.dataDir, { recursive: true }); fs.mkdirSync(this.dataDir, { recursive: true });
} }