Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restarting a running app does not respond to env changes #832

Closed
neonstalwart opened this issue Nov 21, 2014 · 2 comments
Closed

restarting a running app does not respond to env changes #832

neonstalwart opened this issue Nov 21, 2014 · 2 comments

Comments

@neonstalwart
Copy link

there are 2 variations of this problem:

changing value of --env in the command does not use the new env

pm2 startOrRestart pm2.json --env foo
pm2 startOrRestart pm2.json --env bar

the app will still be using the foo env

changing values to be set via env does not use the new values

pm2.json

{
    "apps": [
        {
            "name": "server",
            "script": "server.js",
            "exec_mode": "fork_mode",
            "env_dev": {
                "NODE_ENV": "dev",
                "server_port": "8000"
            }
        }
    ]
}
pm2 startOrRestart pm2.json --env dev

update pm2.json

{
    "apps": [
        {
            "name": "server",
            "script": "server.js",
            "exec_mode": "fork_mode",
            "env_dev": {
                "NODE_ENV": "dev",
                "server_port": "8080"
            }
        }
    ]
}
pm2 startOrRestart pm2.json --env dev

at this point the app will still be using 8000 as the port.

@migg24
Copy link

migg24 commented Nov 24, 2014

This is also a problem for us, because it breaks 0-downtime deployment. You have to delete and then start the processes to refresh the ecosystem successfully.

@Tjatse
Copy link
Collaborator

Tjatse commented Nov 27, 2014

This will be no problem with the dev-branch, be patient and waiting for the release. x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants