fix: delay log file writing to avoid potential race conditions

This commit is contained in:
troyeguo
2026-01-15 17:03:40 +08:00
parent 9bf376de2d
commit 3577d2c19a

View File

@@ -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);
}
}