Skip to content

Commit

Permalink
Merge pull request #23976 from mastrzyz/mastrzyz/remove_concurency_ts…
Browse files Browse the repository at this point in the history
…_issue

Build: Migrate registry util script from JS to TS
  • Loading branch information
yannbf committed Sep 19, 2023
2 parents 63f3384 + d548caa commit d4d799c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
2 changes: 1 addition & 1 deletion scripts/run-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import pLimit from 'p-limit';
import type { Server } from 'http';
import { mkdir } from 'fs/promises';
import { PACKS_DIRECTORY } from './utils/constants';
// @ts-expect-error (Converted from ts-ignore)

import { maxConcurrentTasks } from './utils/concurrency';
import { listOfPackages } from './utils/list-packages';

Expand Down
27 changes: 0 additions & 27 deletions scripts/utils/concurrency.js

This file was deleted.

9 changes: 9 additions & 0 deletions scripts/utils/concurrency.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const os = require('os');

/**
* The maximum number of concurrent tasks we want to have on some CLI and CI tasks.
* The amount of CPUS minus one, arbitrary limited to 15 to not overload CI executors.
* @type {number}
*/
export const maxConcurrentTasks = Math.min(Math.max(1, os.cpus().length - 1), 15);

0 comments on commit d4d799c

Please sign in to comment.