MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / cleanup

Function cleanup

cosplay/cosplay.ts:276–287  ·  view source on GitHub ↗
(files: string[])

Source from the content-addressed store, hash-verified

274}
275
276async 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
289function parseImageCount(text: string | undefined): number {
290 if (!text) return CONFIG.DEFAULT_COUNT;

Callers 1

CosplayPluginClass · 0.70

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected