Skip to content

Commit 04d84d9

Browse files
committed
Improve workerJamDuration mechanism
1 parent fa2cc69 commit 04d84d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

worker/pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (workerPoolSelf *DefaultWorkerPool) trySpawn() {
125125
// Avoid Jam if (now - lastAliveTime) is over workerJamDuration
126126
if time.Now().Sub(workerPoolSelf.lastAliveTime) > workerPoolSelf.workerJamDuration &&
127127
workerPoolSelf.workerCount >= expectedWorkerCount {
128-
expectedWorkerCount++
128+
expectedWorkerCount = workerPoolSelf.workerCount + 1
129129
}
130130
workerPoolSelf.lock.RUnlock()
131131

0 commit comments

Comments
 (0)