fix the stuttering issue on windows

This commit is contained in:
musistudio
2025-07-27 16:10:48 +08:00
parent a778755492
commit 604cc8e1dc

View File

@@ -83,25 +83,25 @@ async function main() {
const cliPath = join(__dirname, "cli.js"); const cliPath = join(__dirname, "cli.js");
const startProcess = spawn("node", [cliPath, "start"], { const startProcess = spawn("node", [cliPath, "start"], {
detached: true, detached: true,
stdio: ["ignore", "pipe", "pipe"], stdio: "ignore",
}); });
let errorMessage = ""; // let errorMessage = "";
startProcess.stderr?.on("data", (data) => { // startProcess.stderr?.on("data", (data) => {
errorMessage += data.toString(); // errorMessage += data.toString();
}); // });
startProcess.on("error", (error) => { startProcess.on("error", (error) => {
console.error("Failed to start service:", error.message); console.error("Failed to start service:", error.message);
process.exit(1); process.exit(1);
}); });
startProcess.on("close", (code) => { // startProcess.on("close", (code) => {
if (code !== 0 && errorMessage) { // if (code !== 0 && errorMessage) {
console.error("Failed to start service:", errorMessage.trim()); // console.error("Failed to start service:", errorMessage.trim());
process.exit(1); // process.exit(1);
} // }
}); // });
startProcess.unref(); startProcess.unref();