Skip to content

Commit

Permalink
Merge pull request #96 from zertosh/single-process
Browse files Browse the repository at this point in the history
Fix processes count and chunk size for run-in-band mode
  • Loading branch information
fkling committed Mar 14, 2016
2 parents 30a21ae + bd473c4 commit ec7c101
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ function run(transformFile, paths, options) {
return;
}

const processes = Math.min(numFiles, cpus);
const chunkSize = Math.min(Math.ceil(numFiles / processes), CHUNK_SIZE);
const processes = options.runInBand ? 1 : Math.min(numFiles, cpus);
const chunkSize = processes > 1 ?
Math.min(Math.ceil(numFiles / processes), CHUNK_SIZE) :
numFiles;

let index = 0;
// return the next chunk of work for a free worker
Expand Down

0 comments on commit ec7c101

Please sign in to comment.