Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.59k stars 2.62k forks source link

Fix #3192: Reloading With --update-env Option #5881

Open mkalygin opened 2 months ago

mkalygin commented 2 months ago
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #3192
License MIT
Doc PR N/A

Hi, this is my first bug fix for pm2. I've been struggling with the issue described in #3192 for a long time. Previously, I used the following hack to make it work properly:

pm2 startOrReload ecosystem.config.cjs --env production && pm2 reload app_name --update-env

After reviewing the code, I believe I have found the actual cause of this bug. The environment gets overriden due to a wrong object extension in Utility.extendExtraConfig.

I'm open to any suggestions for improvements.

CLAassistant commented 2 months ago

CLA assistant check
All committers have signed the CLA.