Skip to content

Commit

Permalink
improve warning message for too many workers
Browse files Browse the repository at this point in the history
  • Loading branch information
wilk committed Apr 18, 2019
1 parent 6eb0f6b commit f4f9b1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/worker-pool.ts
Expand Up @@ -157,7 +157,7 @@ class WorkerPool {
setup(config: SetupConfig = { maxWorkers: AVAILABLE_CPUS }): Promise<void> {
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
Expand Down

0 comments on commit f4f9b1d

Please sign in to comment.