summaryrefslogtreecommitdiff
path: root/doc/api/cluster.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/cluster.md')
-rw-r--r--doc/api/cluster.md13
1 files changed, 5 insertions, 8 deletions
diff --git a/doc/api/cluster.md b/doc/api/cluster.md
index 069f9f2003..858c98dab6 100644
--- a/doc/api/cluster.md
+++ b/doc/api/cluster.md
@@ -523,14 +523,11 @@ When any of the workers die the cluster module will emit the `'exit'` event.
This can be used to restart the worker by calling `.fork()` again.
```js
-cluster.on(
- 'exit',
- (worker, code, signal) => {
- console.log('worker %d died (%s). restarting...',
- worker.process.pid, signal || code);
- cluster.fork();
- }
-);
+cluster.on('exit', (worker, code, signal) => {
+ console.log('worker %d died (%s). restarting...',
+ worker.process.pid, signal || code);
+ cluster.fork();
+});
```
See [child_process event: 'exit'][].