Skip to content

Commit

Permalink
Switch to PM2 fork mode and fix start.sh
Browse files Browse the repository at this point in the history
This commit switches ems-email to use PM2's fork mode, rather than
cluster. This is required to ensure the cron_restart property works
correctly.

I also added a missing exit if an empty key is passed to start.sh
  • Loading branch information
Andrew Isherwood committed Nov 13, 2020
1 parent 907812b commit 7751dab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions ecosystem.config.js.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
autorestart: false,
watch: false,
cron_restart: "*/15 * * * *",
exec_mode: 'fork',
max_memory_restart: '1G',
env: {
NODE_ENV: 'development',
Expand Down
1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ KEY_LEN=$(echo -n $key | wc -m)
if [[ $KEY_LEN = 0 ]]
then
echo "Invalid key passed"
exit
fi

KEY=$key pm2 start --only $instance --env $env

0 comments on commit 7751dab

Please sign in to comment.