Commit d751e3a
committed
Signal handling: Wait for all workers to terminate
The promise returned from `Promise.all()` immediately rejects if any
of the underlying promises reject, even if some of the other promises
have not yet settled. Catch each rejection to give the other promises
an opportunity to resolve.
`Promise.allSettled()` could be used instead, but that's a relatively
new function that was added in Node.js v12.9.0.1 parent 27f9bf2 commit d751e3a
2 files changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 38 | + | |
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments