stop restarting devserver, it's too unstable
This commit is contained in:
parent
622fd4db30
commit
0507ba58b7
@ -39,30 +39,6 @@ esbuild
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
ps.lookup(
|
||||
{
|
||||
command: "node",
|
||||
arguments: "./server/index.js",
|
||||
},
|
||||
(error, processes) => {
|
||||
if (error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
|
||||
if (processes.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const devServerProcess = processes.reduce((prev, current) => {
|
||||
if (prev.pid > current.pid) {
|
||||
return prev;
|
||||
}
|
||||
|
||||
return current;
|
||||
}, processes[0]);
|
||||
process.kill(devServerProcess.pid, "SIGUSR2");
|
||||
},
|
||||
);
|
||||
console.log("Server rebuilt successfully");
|
||||
},
|
||||
}
|
||||
|
@ -100,19 +100,3 @@ const port = process.env.PORT || 3000;
|
||||
app.listen(port, () => {
|
||||
logger.info(`Server listening on port ${port}`);
|
||||
});
|
||||
|
||||
if (environment !== "production") {
|
||||
process.on("SIGUSR2", () => process.exit(229));
|
||||
|
||||
process.on("exit", (exitCode) => {
|
||||
if (exitCode !== 229) {
|
||||
return;
|
||||
}
|
||||
|
||||
require("child_process").spawn(process.argv.shift(), process.argv, {
|
||||
cwd: process.cwd(),
|
||||
detached: true,
|
||||
stdio: "inherit",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user