diff --git a/doc/api/cluster.md b/doc/api/cluster.md index a3dc1239aa8b9f..83a541d6554b13 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -401,19 +401,14 @@ if (cluster.isMaster) { cluster.on('exit', (worker, code, signal) => { console.log('worker is dead:', worker.isDead()); }); - } else { - // Workers can share any TCP connection - // In this case it is an HTTP server + // Workers can share any TCP connection. In this case, it is an HTTP server. http.createServer((req, res) => { res.writeHead(200); res.end(`Current process\n ${process.pid}`); process.kill(process.pid); }).listen(8000); - - // Make http://localhost:8000 to ckeck isDead method. } - ``` ### worker.kill([signal='SIGTERM'])