stop restarting devserver, it's too unstable

This commit is contained in:
m5r 2022-07-08 22:27:27 +02:00
parent 622fd4db30
commit 0507ba58b7
2 changed files with 0 additions and 40 deletions

View File

@ -39,30 +39,6 @@ esbuild
process.exit(1); 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"); console.log("Server rebuilt successfully");
}, },
} }

View File

@ -100,19 +100,3 @@ const port = process.env.PORT || 3000;
app.listen(port, () => { app.listen(port, () => {
logger.info(`Server listening on port ${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",
});
});
}