From c031147aad3934bae92f0cdf1cad2b2292eeda92 Mon Sep 17 00:00:00 2001 From: Amy Date: Sat, 16 Oct 2021 20:08:25 -0400 Subject: [PATCH] Revert "Remove imagePool constructor parameter" This reverts commit 92eec34fa7ef3f51f627a02f12160a6759100fff. --- scripts/optimize-images.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/optimize-images.ts b/scripts/optimize-images.ts index 4eb95848..51b6d8a2 100644 --- a/scripts/optimize-images.ts +++ b/scripts/optimize-images.ts @@ -4,6 +4,7 @@ // TODO: upgrade libsquoosh once types are available: https://github.com/GoogleChromeLabs/squoosh/issues/1077 +import { cpus } from "os"; import path from "path"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -29,7 +30,7 @@ export async function optimizeImages() { const imagePaths = await getFilePathsInDirectory(IMAGES_SOURCE_DIRECTORY); await fse.emptyDir(IMAGES_DESTINATION_DIRECTORY); - const imagePool = new ImagePool(); + const imagePool = new ImagePool(cpus().length); await Promise.all( imagePaths.map(async (imagePath) => {