Skip to content

Commit

Permalink
[7.x] [ts/type_check] use less concurrency, give x-pack more memory (e…
Browse files Browse the repository at this point in the history
…lastic#39419) (elastic#39449)

* [ts/typeCheck] limit concurrency based on CPU count

* [ts/typeCheck] increase memory limit for x-pack type check

* avoid fractional concurrency value

* run typescript script 80 times

* Revert "run typescript script 80 times"

This reverts commit 32bf59b.
  • Loading branch information
Spencer authored Jun 21, 2019
1 parent 247eb86 commit 0ea39af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/dev/typescript/exec_in_projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* under the License.
*/

import os from 'os';

import { ToolingLog } from '@kbn/dev-utils';
import chalk from 'chalk';
import execa from 'execa';
Expand Down Expand Up @@ -47,7 +49,7 @@ export function execInProjects(
title: project.name,
})),
{
concurrent: true,
concurrent: Math.min(4, Math.round((os.cpus() || []).length / 2) || 1) || false,
exitOnError: false,
}
);
Expand Down
7 changes: 6 additions & 1 deletion src/dev/typescript/run_type_check_cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,10 @@ export function runTypeCheckCli() {
process.exit(1);
}

execInProjects(log, projects, 'tsc', project => ['--project', project.tsConfigPath, ...tscArgs]);
execInProjects(log, projects, process.execPath, project => [
...(project.name === 'x-pack' ? ['--max-old-space-size=2048'] : []),
require.resolve('typescript/bin/tsc'),
...['--project', project.tsConfigPath],
...tscArgs,
]);
}

0 comments on commit 0ea39af

Please sign in to comment.