From b7980b7cbff1bab8b22cd0d15330ed48c06434ae Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 4 Aug 2024 00:28:42 -0700 Subject: [PATCH] server: worker pid cleanup --- server/src/plugin/runtime/child-process-worker.ts | 2 +- server/src/plugin/runtime/deno-worker.ts | 4 ---- server/src/plugin/runtime/python-worker.ts | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/server/src/plugin/runtime/child-process-worker.ts b/server/src/plugin/runtime/child-process-worker.ts index 3d526cf65..61479ba49 100644 --- a/server/src/plugin/runtime/child-process-worker.ts +++ b/server/src/plugin/runtime/child-process-worker.ts @@ -18,7 +18,7 @@ export abstract class ChildProcessWorker extends EventEmitter implements Runtime } get pid() { - return this.worker.pid; + return this.worker?.pid; } get stdout() { diff --git a/server/src/plugin/runtime/deno-worker.ts b/server/src/plugin/runtime/deno-worker.ts index 1a16d4e68..111669532 100644 --- a/server/src/plugin/runtime/deno-worker.ts +++ b/server/src/plugin/runtime/deno-worker.ts @@ -80,8 +80,4 @@ export class DenoWorker extends ChildProcessWorker { reject?.(e); } } - - get pid() { - return this.worker?.pid; - } } diff --git a/server/src/plugin/runtime/python-worker.ts b/server/src/plugin/runtime/python-worker.ts index 3bf6b7277..507ebd9db 100644 --- a/server/src/plugin/runtime/python-worker.ts +++ b/server/src/plugin/runtime/python-worker.ts @@ -33,10 +33,6 @@ export class PythonRuntimeWorker extends ChildProcessWorker { _stderr = new PassThrough(); pythonInstallationComplete = true; - get pid() { - return this.worker?.pid || -1; - } - get stdout() { return this._stdout; }