diff --git a/src/lib/background-tasks.ts b/src/lib/background-tasks.ts index 3ca21fcc..305ea389 100644 --- a/src/lib/background-tasks.ts +++ b/src/lib/background-tasks.ts @@ -142,7 +142,7 @@ function ensureLoaded() { if (!file) return; let saved: unknown; try { - saved = JSON.parse(fs.readFileSync(file, 'utf8')); + saved = JSON.parse(fs.readFileSync(/* turbopackIgnore: true */ file, 'utf8')); } catch (error) { if ((error as NodeJS.ErrnoException).code !== 'ENOENT') logger.warn({ error }, 'Failed to read saved background tasks'); return; @@ -173,11 +173,11 @@ function saveNow() { // 唯一临时名,避免并发/多次写盘共用同一路径;失败时清理残留临时文件 const temp = `${file}.${process.pid}.${crypto.randomUUID()}.tmp`; try { - fs.mkdirSync(path.dirname(file), { recursive: true }); - fs.writeFileSync(temp, JSON.stringify([...tasks.values()])); - fs.renameSync(temp, file); + fs.mkdirSync(/* turbopackIgnore: true */ path.dirname(/* turbopackIgnore: true */ file), { recursive: true }); + fs.writeFileSync(/* turbopackIgnore: true */ temp, JSON.stringify([...tasks.values()])); + fs.renameSync(/* turbopackIgnore: true */ temp, /* turbopackIgnore: true */ file); } catch (error) { - fs.rmSync(temp, { force: true }); + fs.rmSync(/* turbopackIgnore: true */ temp, { force: true }); logger.warn({ error }, 'Failed to save background tasks'); } }