mirror of https://github.com/panjf2000/ants.git
update
This commit is contained in:
parent
e99d428a5f
commit
50918eb4a9
2
pool.go
2
pool.go
|
@ -78,7 +78,7 @@ func (p *Pool) periodicallyPurge() {
|
||||||
}
|
}
|
||||||
n++
|
n++
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
if n >= cap(idleWorkers) {
|
if n >= len(idleWorkers) {
|
||||||
p.workers = idleWorkers[:0]
|
p.workers = idleWorkers[:0]
|
||||||
} else {
|
} else {
|
||||||
p.workers = idleWorkers[n:]
|
p.workers = idleWorkers[n:]
|
||||||
|
|
|
@ -79,7 +79,7 @@ func (p *PoolWithFunc) periodicallyPurge() {
|
||||||
}
|
}
|
||||||
n++
|
n++
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
if n >= cap(idleWorkers) {
|
if n >= len(idleWorkers) {
|
||||||
p.workers = idleWorkers[:0]
|
p.workers = idleWorkers[:0]
|
||||||
} else {
|
} else {
|
||||||
p.workers = idleWorkers[n:]
|
p.workers = idleWorkers[n:]
|
||||||
|
|
Loading…
Reference in New Issue