Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nitrocode/pm2-bug-update-env-variable

A reproduction of a bug in pm2
https://github.com/nitrocode/pm2-bug-update-env-variable

Last synced: 8 days ago
JSON representation

A reproduction of a bug in pm2

Awesome Lists containing this project

README

        

# PM2 Bug - Reloading environment variables with zero downtime

Issue [#3192](https://github.com/Unitech/pm2/issues/3192)

# Steps

Install dependencies

npm i

Remove stale logs if there are any

rm -f *.log

Start pm2 with the staging environment

npx pm2 start ecosystem.config.js --env staging

Reload app with zero downtime in a different environment. Also tried `restart`.

npx pm2 reload all --env production --update-env

Check app-0.log

cat app*.log

You will see

Server running at http://127.0.0.1:8000/
staging
Server running at http://127.0.0.1:8000/
staging

Instead of

Server running at http://127.0.0.1:8000/
staging
Server running at http://127.0.0.1:8000/
production