summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/worker_threads.ts
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-03-13 22:52:25 +0530
committerGitHub <noreply@github.com>2024-03-13 17:22:25 +0000
commit0fd8f549e2194223eca2d4b17f4e96cd5a0f5fd5 (patch)
tree76181b2a5f2991134f7343cfc6d4b8b755dbc333 /ext/node/polyfills/worker_threads.ts
parentb3ca3b2f25931afb350027bde87dc3d4f9a741b0 (diff)
fix(ext/node): allow automatic worker_thread termination (#22647)
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'ext/node/polyfills/worker_threads.ts')
-rw-r--r--ext/node/polyfills/worker_threads.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/node/polyfills/worker_threads.ts b/ext/node/polyfills/worker_threads.ts
index 15b51aeb4..4563f157f 100644
--- a/ext/node/polyfills/worker_threads.ts
+++ b/ext/node/polyfills/worker_threads.ts
@@ -211,6 +211,7 @@ class NodeWorker extends EventEmitter {
permissions: null,
name: this.#name,
workerType: "module",
+ closeOnIdle: true,
},
serializedWorkerMetadata,
);
@@ -413,7 +414,7 @@ internals.__initWorkerThreads = (
>();
parentPort = self as ParentPort;
- if (typeof maybeWorkerMetadata !== "undefined") {
+ if (maybeWorkerMetadata) {
const { 0: metadata, 1: _ } = maybeWorkerMetadata;
workerData = metadata.workerData;
environmentData = metadata.environmentData;