We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26b0141 commit 27f9bf2Copy full SHA for 27f9bf2
src/master/implementation.node.ts
@@ -32,7 +32,10 @@ interface Terminable {
32
33
// Terminates the workers, empties the workers array, and exits.
34
const onSignal = (workers: Terminable[], signal: string) => {
35
- Promise.all(workers.map(worker => worker.terminate())).then(
+ // worker.terminate() might return a Promise or might be synchronous. This async helper function
36
+ // creates a consistent interface.
37
+ const terminate = async (worker: Terminable) => worker.terminate()
38
+ Promise.all(workers.map(worker => terminate(worker))).then(
39
() => process.exit(1),
40
41
)
0 commit comments