From f4f9b1da53c0483c0a157cffcc97b7aab6179d29 Mon Sep 17 00:00:00 2001 From: Wilk Date: Thu, 18 Apr 2019 07:39:16 +0200 Subject: [PATCH] improve warning message for too many workers --- src/worker-pool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker-pool.ts b/src/worker-pool.ts index 40f059e..8597527 100644 --- a/src/worker-pool.ts +++ b/src/worker-pool.ts @@ -157,7 +157,7 @@ class WorkerPool { setup(config: SetupConfig = { maxWorkers: AVAILABLE_CPUS }): Promise { this.maxWorkers = config.maxWorkers > 0 ? config.maxWorkers : AVAILABLE_CPUS - if (this.maxWorkers > 10) console.warn(`Worker pool has too many workers.\nThis may lead to a memory leak.\nLimit them with start({maxWorkers: 10})`) + if (this.maxWorkers > 10) console.warn(`Worker pool has more than 10 workers.\nYou should also increase the Max Listeners of Node.js (https://nodejs.org/docs/latest/api/events.html#events_emitter_setmaxlisteners_n)\nOtherwise, limit them with start({maxWorkers: 10})`) return new Promise((resolve, reject) => { let counterSuccess = 0