-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Adds --cluster support #2596
Adds --cluster support #2596
Conversation
Current coverage is 92.10% (diff: 100%)@@ master #2596 diff @@
==========================================
Files 98 98
Lines 11956 11956
Methods 1463 1463
Messages 0 0
Branches 1931 1931
==========================================
- Hits 11013 11012 -1
- Misses 943 944 +1
Partials 0 0
|
When a forked process exits, the behaviour is a little different to throng which seems to be restarting that process: https://github.com/hunterloftis/throng/blob/master/lib/throng.js#L39 This would be important in keeping a constant number of processes when one of them has a problem. LGTM apart from that and really useful. |
Uhh you're right :) so call another fork on('exit'), I'll run some tests locally to see what's going on |
@@ -85,7 +85,8 @@ if (options.cluster) { | |||
cluster.fork(); | |||
} | |||
cluster.on('exit', (worker, code, signal) => { | |||
console.log(`worker ${worker.process.pid} died`); | |||
console.log(`worker ${worker.process.pid} died... Restarting`); | |||
cluster.fork(); |
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.
@steven-supersolid I believe that will do :)
@flovilmart updated the pull request - view changes |
Merging as reviewed by @steven-supersolid and side effect less. |
Adds ability to start a mulitprocessed parse-server through cluster when using the CLI.
--cluster
to automatically select the number of processes--cluster 2
to start 2 processes