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

Infinite max_restarts #559

Closed
CodersBrothers opened this issue Jul 8, 2014 · 5 comments
Closed

Infinite max_restarts #559

CodersBrothers opened this issue Jul 8, 2014 · 5 comments

Comments

@CodersBrothers
Copy link

Hi, im using cron features like a maintenance service of my app. Im using processes.json like a instrucctins for pm2. The problem is in the cron_restart param, i need put something but i want run the cron every minute every year. I dont want put something like 99999999 in the value. this sucks.

Maybe will be cool something like a 0 param? or not default.

{
    "apps" : [
        {
            "name"        : "Test",
            "instances"   : "max",
            "script"      : "./app.js",
            "args"        : "['--port=3332']",
            "exec_mode"   : "cluster_mode"
        },
        {
            "name"        : "Cron: Add products",
            "script"      : "./cron/importOffers.js",
            "cron_restart": "0 * * * *",
            "max_restarts": "0",
            "exec_mode"   : "fork_mode"
        }
    ]
}
@soyuka
Copy link
Collaborator

soyuka commented Jul 8, 2014

It seams easier to write an actually cron by starting node your-app.js every minute.

@CodersBrothers
Copy link
Author

so, why exists this cron feature, param? I use before separate cron, first with the system cron and later with node module in other script. But its really tired be all separated if all its part of the same APP.

@CodersBrothers
Copy link
Author

Arggggg!! I misunderstood how works this feature :(
This not replace cron functionality. Not its the best way. Will be cool unify processes in pm2

@soyuka soyuka closed this as completed Jul 9, 2014
@rlidwka
Copy link
Collaborator

rlidwka commented Jul 10, 2014

Hmm... why does cron_restart even exist? We could add pm2 restart whatever to an actual cron as well.

@soyuka
Copy link
Collaborator

soyuka commented Jul 10, 2014

@rlidwka I agree.

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