Revert "Remove imagePool constructor parameter"

This reverts commit 92eec34fa7.
This commit is contained in:
Amy 2021-10-16 20:08:25 -04:00
parent 609d10732c
commit c031147aad
1 changed files with 2 additions and 1 deletions

View File

@ -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) => {