()
| 152 | this.initialized = false; |
| 153 | this.db = null; |
| 154 | await this.init(); |
| 155 | } |
| 156 | |
| 157 | private static async createBackup(): Promise<void> { |
| 158 | try { |
| 159 | const configExists = await fs.access(this.configPath).then(() => true).catch(() => false); |
| 160 | if (configExists) { |
| 161 | await fs.copyFile(this.configPath, this.backupPath); |
| 162 | console.log("[zpr] 配置备份创建成功"); |