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

fix: autostart = false prevents apps from being started #5840

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jjensenbloom
Copy link

@jjensenbloom jjensenbloom commented Jun 7, 2024

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #5831
License MIT
Doc PR https://github.com/pm2-hive/pm2-hive.github.io/pulls

Only check the autostart parameter when the app doesn't exist already
@CLAassistant
Copy link

CLAassistant commented Jun 7, 2024

CLA assistant check
All committers have signed the CLA.

@jjensenbloom jjensenbloom changed the title Update God.js Fix autostart: false Jun 7, 2024
@jjensenbloom jjensenbloom changed the title Fix autostart: false fix: autostart = false prevents apps from being started Jun 7, 2024
@@ -207,16 +208,16 @@ God.executeApp = function executeApp(env, cb) {
if (env_copy['watch']) {
God.watch.enable(env_copy);
}

if (!env_copy['autostart']) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be a somewhat breaking change of default behaviour to change env_copy['autostart'] === false to !env_copy['autostart'], meaning if the user does not specify the autostart field, i.e. env_copy['autostart'] === undefined, previously it will auto start, but now it will no longer auto start

Copy link

@noelzubin noelzubin Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure, but looks like the value for autorestart defaults to true if not set in the client signal.

pm2/lib/API.js

Line 681 in 87612eb

var app_conf = Config.filterOptions(opts);

pm2/lib/API.js

Line 879 in 87612eb

that.Client.executeRemote('prepare', resolved_paths, function(err, data) {

@lvlingxiao1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not entirely sure either, looks like the filterOptions method just filters out all the options that do not exist in the schema, I don't see any default values though, I think the default is just undefined

Copy link

@noelzubin noelzubin Jul 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh my bad. I meant to link this .

pm2/lib/API.js

Line 701 in 87612eb

if ((appConf = Common.verifyConfs(app_conf)) instanceof Error) {

Common.verifyConfs(app_confi) @ lib/API.js:701
Config.validateJSON(app) @ lib/Common.js:850
res[sk] = defines[sk].default @ lib/tools/Config.js:114

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

Successfully merging this pull request may close these issues.

4 participants