Skip to content

Commit e5537bf

Browse files
committed
fix: An issue where terminate() would try to force kill the process even if it had already exited
1 parent 7a9b567 commit e5537bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DenoWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,11 @@ export class DenoWorker {
350350
*/
351351
terminate() {
352352
this._terminated = true;
353-
if (this._process) {
353+
if (this._process && this._process.exitCode === null) {
354354
// this._process.kill();
355355
forceKill(this._process.pid);
356-
this._process = null;
357356
}
357+
this._process = null;
358358
if (this._httpServer) {
359359
this._httpServer.close();
360360
}

0 commit comments

Comments
 (0)