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 a3068c0 commit ac76cc3Copy full SHA for ac76cc3
src/master/implementation.node.ts
@@ -33,7 +33,10 @@ interface Terminable {
33
34
// Terminates the workers, empties the workers array, and exits.
35
const onSignal = (workers: Terminable[], signal: string) => {
36
- Promise.all(workers.map(worker => worker.terminate())).then(
+ // worker.terminate() might return a Promise or might be synchronous. This async helper function
37
+ // creates a consistent interface.
38
+ const terminate = async (worker: Terminable) => worker.terminate()
39
+ Promise.all(workers.map(worker => terminate(worker))).then(
40
() => process.exit(1),
41
42
)
0 commit comments