-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
base: master
Are you sure you want to change the base?
Conversation
jjensenbloom
commented
Jun 7, 2024
•
edited
Loading
edited
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
@@ -207,16 +208,16 @@ God.executeApp = function executeApp(env, cb) { | |||
if (env_copy['watch']) { | |||
God.watch.enable(env_copy); | |||
} | |||
|
|||
if (!env_copy['autostart']) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Line 681 in 87612eb
var app_conf = Config.filterOptions(opts); |
Line 879 in 87612eb
that.Client.executeRemote('prepare', resolved_paths, function(err, data) { |
@lvlingxiao1
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 .
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