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

Revisions for dev branch #838

Merged
merged 11 commits into from
Nov 25, 2014
Merged

Revisions for dev branch #838

merged 11 commits into from
Nov 25, 2014

Conversation

Tjatse
Copy link
Collaborator

@Tjatse Tjatse commented Nov 24, 2014

  • Reload env graceful and peaceful

  • Unify appConf - rename ignoreWatch to ignore_watch

  • Documents of Schema

  • CLI ignore_watch supports

  • Validate Commander options and JSON key-values

  • Divide String to Array more intelligence (ESC supports)

    $pm2 start test.js --node-args "port=3001 sitename='first pm2 app'"
    

    The nodeArgs will be

    [
      "port=3001",
      "sitename=first pm2 app"
    ]

    But not

    [
      "port=3001",
      "sitename='first",
      "pm2",
      "app'"
    ]
  • Make options briefness and easy configuration

    • min_uptime

      Value of min_uptime could be:

      • Number
        e.g. "min_uptime": 3000 means 3000 milliseconds.
      • String
        In the meantime we are making it briefness and easy configuration: h, m and s, e.g.: "min_uptime": "1h" means one hour, "min_uptime": "5m" means five minutes and "min_uptime": "10s" means ten seconds (At last, it will be transformed into milliseconds).
    • max_memory_restart

      Value of max_memory_restart could be:

      • Number
        e.g. "max_memory_restart": 1024 means 1024 bytes (NOT BITS).
      • String
        In the meantime we are making it briefness and easy configuration: G, M and K, e.g.: "max_memory_restart": "1G" means one gigabytes, "max_memory_restart": "5M" means five megabytes and "max_memory_restart": "10K" means ten kilobytes (At last, it will be transformed into byte(s)).
  • Refactor start/restart/reload (CLI, JSON), auto inspect configurations by configured schema, more output information, more humanity.

@Tjatse
Copy link
Collaborator Author

Tjatse commented Nov 24, 2014

#832 #805 #768

@Tjatse
Copy link
Collaborator Author

Tjatse commented Nov 24, 2014

Renamed Common.resolveAppPaths to Common.prepareAppConf and made a completely replacement.

@Tjatse Tjatse added the invalid label Nov 24, 2014
@Tjatse Tjatse removed the invalid label Nov 24, 2014
@Tjatse
Copy link
Collaborator Author

Tjatse commented Nov 24, 2014

Everything goes fine now, sorry about the untidy commits ;)

Changes:

  • "max_memory_restart": 1024 or --max-memory-restart 1024 means 1024 bytes, not 1024MB ("max_memory_restart": "1024M" instead of it)
  • fork/fork_mode will be converted into fork_mode by ConfigValidator, and cluster/cluster_mode will be converted into cluster_mode, so, it's safety to use pm2_env.exec_mode == 'cluster_mode' programmatic, and no need to check it twice like pm2_env.exec_mode == 'cluster_mode' || pm2_env.exec_mode == 'cluster'
  • Predications of ConfigValidator are defined in /lib/schema.json and compiled by /lib/tools/Config.js.

@soyuka
Copy link
Collaborator

soyuka commented Nov 24, 2014

I'll review this as soon as I can @Tjatse looks awesome!

@Tjatse
Copy link
Collaborator Author

Tjatse commented Nov 25, 2014

@soyuka Thats great, thx!

@@ -507,6 +505,7 @@ commander.command('ilogs')
commander.command('kill')
.description('kill daemon')
.action(failOnUnknown(function(arg) {
console.log('kill')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Left on purpose?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ops, MISTAKE, forgot to remove!!!

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's why I'm here for (:

@Unitech
Copy link
Owner

Unitech commented Nov 25, 2014

Awesome PR, thanks! I'm reviewing it

Unitech added a commit that referenced this pull request Nov 25, 2014
@Unitech Unitech merged commit 8246573 into Unitech:development Nov 25, 2014
@Unitech
Copy link
Owner

Unitech commented Nov 26, 2014

I made some correction to the code:

allow array and string for watch option -- add some tests for JSON validation
007231a

homogeneize option parsing logic between JSON and CLI execution - cancel JSON execution if there are errors - cleanly exit PM2 CLI with exitCli()
1244da1

State ERRORED_STATUS like stopped/stopping - calling reloadProcessId restart app if stopped or not cluster_mode (fix pull&reload bug) - change exec logic order - flattify Methods.backward
0b3a2c6

Works well now!

@Tjatse
Copy link
Collaborator Author

Tjatse commented Nov 26, 2014

Great jobs 👍

Unity is strength :p

You guys rock!!

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.

None yet

3 participants