Skip to content

Commit

Permalink
Update messenger state upon killing subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
d-gubert committed Jul 5, 2024
1 parent c8a3324 commit 79aa16e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/server/runtime/deno/AppsEngineDenoRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export class DenoRuntimeSubprocessController extends EventEmitter {
}

delete this.deno;
this.messenger.clearReceiver();
}

// Debug purposes, could be deleted later
Expand Down
6 changes: 6 additions & 0 deletions src/server/runtime/deno/ProcessMessenger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export class ProcessMessenger {
this.switchStrategy();
}

public clearReceiver() {
delete this.deno;

this.switchStrategy();
}

private switchStrategy() {
if (this.deno instanceof ChildProcess) {
this._sendStrategy = this.strategySend.bind(this);
Expand Down

0 comments on commit 79aa16e

Please sign in to comment.