From 0507ba58b78d8c1b355fd9912d81d9b0bcf0fa6d Mon Sep 17 00:00:00 2001 From: m5r Date: Fri, 8 Jul 2022 22:27:27 +0200 Subject: [PATCH] stop restarting devserver, it's too unstable --- scripts/build-server.js | 24 ------------------------ server/index.ts | 16 ---------------- 2 files changed, 40 deletions(-) diff --git a/scripts/build-server.js b/scripts/build-server.js index 8247eda..293e4dd 100644 --- a/scripts/build-server.js +++ b/scripts/build-server.js @@ -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"); }, } diff --git a/server/index.ts b/server/index.ts index 8f511e6..7ac1ced 100644 --- a/server/index.ts +++ b/server/index.ts @@ -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", - }); - }); -}