repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
perf: fine tune continuous task stealing algorithm
[poolifier.git]
/
src
/
pools
/
worker-node.ts
diff --git
a/src/pools/worker-node.ts
b/src/pools/worker-node.ts
index 9ecfd012f9b5402c4676004f24f7c04ecc4bf020..fbd00096a769d53cd5d3d9415fae64c428cfb3ee 100644
(file)
--- a/
src/pools/worker-node.ts
+++ b/
src/pools/worker-node.ts
@@
-178,7
+178,11
@@
implements IWorkerNode<Worker, Data> {
}
private async startOnEmptyQueue (): Promise<void> {
- if (this.tasksQueue.size > 0) {
+ if (
+ this.onEmptyQueueCount > 0 &&
+ this.usage.tasks.executing > 0 &&
+ this.tasksQueue.size > 0
+ ) {
this.onEmptyQueueCount = 0
return
}