| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,9 +140,9 @@ Similar to the `cluster.on('exit')` event, but specific to this worker. | |||
| 140 | 140 | ```js | |
| 141 | 141 | const worker = cluster.fork(); | |
| 142 | 142 | worker.on('exit', (code, signal) => { | |
| 143 | - if( signal ) { | ||
| 143 | + if (signal) { | ||
| 144 | 144 | console.log(`worker was killed by signal: ${signal}`); | |
| 145 | - } else if( code !== 0 ) { | ||
| 145 | + } else if (code !== 0) { | ||
| 146 | 146 | console.log(`worker exited with error code: ${code}`); | |
| 147 | 147 | } else { | |
| 148 | 148 | console.log('worker success!'); | |
@@ -285,7 +285,7 @@ if (cluster.isMaster) { | |||
| 285 | 285 | server.listen(8000); | |
| 286 | 286 | ||
| 287 | 287 | process.on('message', (msg) => { | |
| 288 | - if(msg === 'shutdown') { | ||
| 288 | + if (msg === 'shutdown') { | ||
| 289 | 289 | // initiate graceful close of any connections to server | |
| 290 | 290 | } | |
| 291 | 291 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments