Skip to content

Commit 45dfea8

Browse files
committed
fix: change worker test core count to 1
1 parent 960be7c commit 45dfea8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/lib/workers/test-workers.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import * as os from 'os';
21
import process from 'process';
32
import { Pool, spawn, Worker } from 'threads';
43

54
async function testWorkers() {
65
process.stdout.write('Lets test workers.\n');
7-
const coreCount = os.cpus().length;
8-
const pool = Pool(() => spawn(new Worker('./worker')), coreCount);
9-
for (let i = 0; i < coreCount; i++) {
6+
const pool = Pool(() => spawn(new Worker('./worker')), 1);
7+
for (let i = 0; i < 1; i++) {
108
void pool.queue(async (hellower) => {
119
process.stdout.write((await hellower.helloWorld()) + '\n');
1210
});

0 commit comments

Comments
 (0)