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

Can't remove cron_restart #2958

Closed
sylc opened this issue Jun 22, 2017 · 1 comment
Closed

Can't remove cron_restart #2958

sylc opened this issue Jun 22, 2017 · 1 comment

Comments

@sylc
Copy link

sylc commented Jun 22, 2017

What's going wrong?
I cannot seem to be able to remove/cancel a cron_restart property.

How could we reproduce this issue?
I have a processes.json as follow

[
  {
    "script"    : "app.js",
    "args"      : "start-server",
    "name"      : "myapp",
    "exec_mode" : "cluster",
    "instances" : "max",
    "watch"     : false,
   "cron_restart" : "*/5 * * * *",
    "env": {
      "NODE_ENV": "production"
    }
  }
]

If i change cron_restart to another value like "*/10 * * * *" and run

pm2 reload processes.json --update-env --only myapp
pm2 save

the cron pattern is updated as expected in /.pm2/dump.pm2 and the restart happen as expected.

if now i remove the cron_restart property from the processes.json file, and redo,

pm2 reload processes.json --update-env --only myapp
pm2 save

the cron_restart property is still present in /.pm2/dump.pm2 and the app will restart.

Supporting information

PM2 version: `2.4.6`
Node version: `6.10.3`
Linux

My current workaround is to pm2 delete myapp and pm2 reload processes.json --update-env --only myapp

@Unitech
Copy link
Owner

Unitech commented Jun 26, 2017

Application configuration environment is state full so yes this is exact, the solution is to totally reset the process environment by doing a pm2 delete ; pm2 reload <process.json>

@Unitech Unitech closed this as completed Jun 26, 2017
inerc pushed a commit to inerc/pm2 that referenced this issue Feb 11, 2020
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

2 participants