Skip to content

Commit 03c5fbe

Browse files
committed
Use process.kill SIGTERM for file shutdown behavior
1 parent 2d79605 commit 03c5fbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node/routes/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
172172

173173
if (args["allow-shutdown"] ) {
174174
app.router.use("/shutdown", async (req, res) => {
175-
res.send("Shutting down...")
176-
process.exit(0)
175+
res.send(`Shutting down...`)
176+
process.kill(process.pid, "SIGTERM")
177177
})
178178
} else {
179179
app.router.use("/shutdown", (req, res) => redirect(req, res, "/", {}))

0 commit comments

Comments
 (0)