From 07783b850f6ca370b70c7638ac3df07877aaf201 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 25 Jun 2023 16:28:20 +0200 Subject: [PATCH] fix: node-worker-threads-pool needs inline imports in code block MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../versus-external-pools/functions/function-to-bench.mjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/benchmarks/versus-external-pools/functions/function-to-bench.mjs b/benchmarks/versus-external-pools/functions/function-to-bench.mjs index 4705273c..26f56d04 100644 --- a/benchmarks/versus-external-pools/functions/function-to-bench.mjs +++ b/benchmarks/versus-external-pools/functions/function-to-bench.mjs @@ -1,6 +1,3 @@ -import crypto from 'crypto' -import fs from 'fs' - /** * The worker function to execute during pools benchmarks. * NOTE: This function requires to be self-contained, thread-safe and re-entrant. @@ -8,6 +5,8 @@ import fs from 'fs' * @returns {*} The result. */ export default function functionToBench (data) { + const crypto = import('crypto') + const fs = import('fs') const TaskTypes = { CPU_INTENSIVE: 'CPU_INTENSIVE', IO_INTENSIVE: 'IO_INTENSIVE' -- 2.34.1