repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test: fix async/await imbalance
[poolifier.git]
/
src
/
worker
/
abstract-worker.ts
diff --git
a/src/worker/abstract-worker.ts
b/src/worker/abstract-worker.ts
index 311a56ad60e00684835e89ef0507d60f0c9d4432..d0803b8da98d59ca9018cd190d6020d871dfad2e 100644
(file)
--- a/
src/worker/abstract-worker.ts
+++ b/
src/worker/abstract-worker.ts
@@
-100,6
+100,7
@@
export abstract class AbstractWorker<
this.checkTaskFunctions(taskFunctions)
this.checkWorkerOptions(this.opts)
if (!this.isMain) {
this.checkTaskFunctions(taskFunctions)
this.checkWorkerOptions(this.opts)
if (!this.isMain) {
+ // Should be once() but Node.js on windows has a bug that prevents it from working
this.getMainWorker().on('message', this.handleReadyMessage.bind(this))
}
}
this.getMainWorker().on('message', this.handleReadyMessage.bind(this))
}
}
@@
-373,7
+374,7
@@
export abstract class AbstractWorker<
(this.opts.killHandler?.() as Promise<void>)
.then(() => {
this.sendToMainWorker({ kill: 'success' })
(this.opts.killHandler?.() as Promise<void>)
.then(() => {
this.sendToMainWorker({ kill: 'success' })
- return
null
+ return
undefined
})
.catch(() => {
this.sendToMainWorker({ kill: 'failure' })
})
.catch(() => {
this.sendToMainWorker({ kill: 'failure' })