Use os.availableParallelism() instead of os.cpus().length

* As https://nodejs.org/api/os.html#oscpus says:
  os.cpus().length should not be used to calculate the amount of parallelism available to an application. Use os.availableParallelism() for this purpose.
This commit is contained in:
Benoit Daloze
2025-10-27 12:32:05 +01:00
parent a96ff531da
commit 274049f8cf
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
}
// Number of jobs should scale with runner, up to a point
const jobs = Math.min(os.cpus().length, 8)
const jobs = Math.min(os.availableParallelism(), 8)
// Always run 'bundle install' to list the gems
await exec.exec('bundle', ['install', '--jobs', jobs])
Generated Vendored
+1 -1
View File
@@ -209,7 +209,7 @@ async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, b
}
// Number of jobs should scale with runner, up to a point
const jobs = Math.min(os.cpus().length, 8)
const jobs = Math.min(os.availableParallelism(), 8)
// Always run 'bundle install' to list the gems
await exec.exec('bundle', ['install', '--jobs', jobs])