fix: always launch worker inside of createModule

This commit is contained in:
Derrick Hammer 2023-07-04 02:06:41 -04:00
parent 2671fa35a7
commit 7093494227
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 8 additions and 0 deletions

View File

@ -219,6 +219,14 @@ async function createModule(
return launchWorker(mod);
},
};
// Start worker
const [worker, err] = mod.launchWorker();
if (err !== null) {
return [{} as Module, addContextToErr(err, "unable to launch worker")];
}
mod.worker = worker;
return [mod, null];
}