fix(ext/node): allow automatic worker_thread termination (#22647)

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
This commit is contained in:
Satya Rohith 2024-03-13 22:52:25 +05:30 committed by GitHub
parent b3ca3b2f25
commit 0fd8f549e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 64 additions and 25 deletions

View file

@ -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;