Skip to content

Commit

Permalink
fix stupid issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DemonMartin committed Aug 20, 2024
1 parent ae6bc42 commit 59b25b4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion utils/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ class Client {

startWorkerPool() {
return workerpool.pool(path.join(__dirname, 'client.js'), {
workerThreadOpts: {
argv: [this.TLS_LIB_PATH]
}
})
}
}
Expand All @@ -108,7 +111,14 @@ export default Client;

// For the workerpool to work, you need to run the following code
if (!workerpool.isMainThread) {
const client = new Client();
while (!fs.existsSync(process.argv[2])) {
// Wait for the library to be downloaded
setTimeout(() => { }, 100);
}

const client = new Client({
customLibraryPath: process.argv[2]
});
await client.open();
client.startWorker();
}

0 comments on commit 59b25b4

Please sign in to comment.