X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fcluster-worker.mjs;h=69a7ad15cae0ada671f3e4f8ef1261305d26e51a;hb=8a11c8fd0b8be823629d0475ee16362b0bb31d25;hp=bc3548394616f1426f48dda0c8a4e9719937e15d;hpb=8ebe6c308dc1fc3202980126da043b2855d24780;p=poolifier.git diff --git a/benchmarks/internal/cluster-worker.mjs b/benchmarks/internal/cluster-worker.mjs index bc354839..69a7ad15 100644 --- a/benchmarks/internal/cluster-worker.mjs +++ b/benchmarks/internal/cluster-worker.mjs @@ -1,15 +1,15 @@ -import { isMaster } from 'cluster' +import { isPrimary } from 'node:cluster' import { ClusterWorker } from '../../lib/index.mjs' import { executeTaskFunction } from '../benchmarks-utils.mjs' import { TaskFunctions } from '../benchmarks-types.mjs' const debug = false -const taskFunction = (data) => { +const taskFunction = data => { data = data || {} data.function = data.function || TaskFunctions.jsonIntegerSerialization const res = executeTaskFunction(data) - debug === true && console.debug('This is the main thread ' + isMaster) + debug === true && console.debug(`This is the main thread ${isPrimary}`) return res }