From 3577d2c19a62b296706ba722adb45a516bc5e36f Mon Sep 17 00:00:00 2001 From: troyeguo <13820674+troyeguo@users.noreply.github.com> Date: Thu, 15 Jan 2026 17:03:40 +0800 Subject: [PATCH] fix: delay log file writing to avoid potential race conditions --- main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 65115d06..37108dbf 100644 --- a/main.js +++ b/main.js @@ -899,7 +899,9 @@ const createMainWin = () => { ); if (_data && _data.filePath) { filePath = _data.filePath; - fs.writeFileSync(path.join(dirPath, "log.json"), "", "utf-8"); + setTimeout(() => { + fs.writeFileSync(path.join(dirPath, "log.json"), "", "utf-8"); + }, 1000); } }