Skip to content

Commit

Permalink
TURBO env var
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Sep 23, 2024
1 parent a7ec37b commit cc04f10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/feeder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import cluster from 'node:cluster';
import { availableParallelism } from 'node:os';
import process from 'node:process';

const numCPUs = availableParallelism();

const numCPUs = availableParallelism() * (parseFloat(process.env.TURBO) || 1);
const TESTNET_CSV = '../strategy-pit/__tests__/fixtures/testnet-sarafu.csv';

if (cluster.isPrimary) {
console.log(`Primary ${process.pid} is running`);
console.log(`Primary ${process.pid} is running, forking ${numCPUs} threads`);

// Fork workers.
for (let i = 0; i < numCPUs; i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import process from 'node:process';
import { RedisStores } from './redis.js';
import { InMemStores } from './inmem.js';

const numCPUs = availableParallelism();
const numCPUs = availableParallelism() * (parseFloat(process.env.TURBO) || 1);

if (cluster.isPrimary) {
console.log(`Primary ${process.pid} is running`);
console.log(`Primary ${process.pid} is running, forking ${numCPUs} threads`);

// Fork workers.
for (let i = 0; i < numCPUs; i++) {
Expand Down

0 comments on commit cc04f10

Please sign in to comment.