Skip to content

Commit da3b686

Browse files
gribnoysupaddaleax
andauthored
fix(node-runtime-worker-thread): Actually wait for the worker child process to terminate before resolving
Co-authored-by: Anna Henningsen <[email protected]>
1 parent b2da534 commit da3b686

File tree

1 file changed

+3
-0
lines changed
  • packages/node-runtime-worker-thread/src

1 file changed

+3
-0
lines changed

packages/node-runtime-worker-thread/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ class WorkerRuntime implements Runtime {
102102
async terminate() {
103103
await this.initWorkerPromise;
104104
this.childProcess.kill('SIGTERM');
105+
if (this.childProcess.exitCode === null && this.childProcess.signalCode === null) {
106+
await once(this.childProcess, 'exit');
107+
}
105108
}
106109
}
107110

0 commit comments

Comments
 (0)