Permalink
Browse files

Only shell out to systemd-notify in production

There's no point having this happen in dev. Basing the determination
on the value of NODE_ENV is the simplest option.
  • Loading branch information...
lovett committed Jan 7, 2019
1 parent fb236cf commit 9bedc2777e456952c3d39efe6c44ae7c81e6a0fb
Showing with 5 additions and 1 deletion.
  1. +5 −1 server/server.ts
@@ -240,7 +240,11 @@ if (!module.parent) {

server.on('listening', () => {
process.stdout.write(`Listening on ${ip}:${port}\n`);
childProcess.exec(`/bin/systemd-notify --ready --pid=${process.pid}`);

// Tell systemd that startup has completed and all systems are go.
if (process.env.NODE_ENV === 'production') {
childProcess.exec(`/bin/systemd-notify --ready --pid=${process.pid}`);
}
});
})
.catch((err) => {

0 comments on commit 9bedc27

Please sign in to comment.