[7.x] [ts/type_check] use less concurrency, give x-pack more memory (#39419) (#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 32bf59b84f.
This commit is contained in:
Spencer 2019-06-21 10:29:59 -07:00 committed by GitHub
parent 247eb8602c
commit 0ea39afd6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -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';
@ -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,
}
);

View file

@ -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,
]);
}