From 16217a8aa136e04d3acedd7df8b2c495f469efb8 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Sun, 13 Feb 2022 22:03:13 +0100 Subject: [PATCH] Minify: do not require MinifyWorker two times when creating a pool of two workers --- src/node/utils/Minify.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/utils/Minify.js b/src/node/utils/Minify.js index 2e8a2d960..b5f9146a1 100644 --- a/src/node/utils/Minify.js +++ b/src/node/utils/Minify.js @@ -35,7 +35,8 @@ const logger = log4js.getLogger('Minify'); const ROOT_DIR = path.join(settings.root, 'src/static/'); -const threadsPool = new Threads.Pool(() => Threads.spawn(new Threads.Worker('./MinifyWorker')), 2); +const threadWorker = new Threads.Worker('./MinifyWorker'); +const threadsPool = new Threads.Pool(() => Threads.spawn(threadWorker), 2); const LIBRARY_WHITELIST = [ 'async',