-const estCpuSpeed = estimatedCpuSpeed()
-
-const getDefaultWorkerWeight = (estimatedCpuSpeed = estCpuSpeed): number => {
+const getDefaultWorkerWeight = (): number => {
+ const currentCpus = cpus()
+ let estCpuSpeed: number | undefined
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+ if (currentCpus.every(cpu => cpu.speed == null || cpu.speed === 0)) {
+ estCpuSpeed = estimatedCpuSpeed()
+ }