(files: string[])
| 274 | } |
| 275 | |
| 276 | async function cleanup(files: string[]): Promise<void> { |
| 277 | // 真实资源清理:释放插件持有的定时器、监听器、运行时状态或临时资源。 |
| 278 | await Promise.allSettled( |
| 279 | files.map(async (filePath) => { |
| 280 | try { |
| 281 | await fs.promises.unlink(filePath); |
| 282 | } catch (error) { |
| 283 | console.warn(`清理临时文件失败: ${filePath}`); |
| 284 | } |
| 285 | }) |
| 286 | ); |
| 287 | } |
| 288 | |
| 289 | function parseImageCount(text: string | undefined): number { |
| 290 | if (!text) return CONFIG.DEFAULT_COUNT; |