Commit 58d04b3
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 7877248 commit 58d04b3
2 files changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 39 | + | |
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
| |||
| 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