From 0af3e5a93ae4ab87dc2c4cf6f0991e6ae1ca9736 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Tue, 12 Nov 2024 12:25:26 +0200 Subject: [PATCH] Renamed worker_threads.Worker to WorkerThread to distinguish between BullMQ Worker --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index e76e5b98..2c8724d6 100644 --- a/server.js +++ b/server.js @@ -27,7 +27,7 @@ process.env.UV_THREADPOOL_SIZE = // cache before wild-config const argv = process.argv.slice(2); -const { Worker, SHARE_ENV } = require('worker_threads'); +const { Worker: WorkerThread, SHARE_ENV } = require('worker_threads'); const packageData = require('./package.json'); const config = require('wild-config'); const logger = require('./lib/logger'); @@ -695,7 +695,7 @@ let spawnWorker = async type => { await updateServerState(type, 'spawning'); } - let worker = new Worker(pathlib.join(__dirname, 'workers', `${type.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`)}.js`), { + let worker = new WorkerThread(pathlib.join(__dirname, 'workers', `${type.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`)}.js`), { argv, env: SHARE_ENV, trackUnmanagedFds: true