mirror of https://github.com/panjf2000/ants.git
bug: fix the last error being missed in ReleaseTimeout() for multi-pool (#334)
This commit is contained in:
parent
b40e489286
commit
313f136d00
13
multipool.go
13
multipool.go
|
@ -201,16 +201,9 @@ func (mp *MultiPool) ReleaseTimeout(timeout time.Duration) error {
|
|||
|
||||
_ = wg.Wait()
|
||||
|
||||
var (
|
||||
i int
|
||||
errStr strings.Builder
|
||||
)
|
||||
for err := range errCh {
|
||||
i++
|
||||
if i == len(mp.pools) {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
var errStr strings.Builder
|
||||
for i := 0; i < len(mp.pools); i++ {
|
||||
if err := <-errCh; err != nil {
|
||||
errStr.WriteString(err.Error())
|
||||
errStr.WriteString(" | ")
|
||||
}
|
||||
|
|
|
@ -191,16 +191,9 @@ func (mp *MultiPoolWithFunc) ReleaseTimeout(timeout time.Duration) error {
|
|||
|
||||
_ = wg.Wait()
|
||||
|
||||
var (
|
||||
i int
|
||||
errStr strings.Builder
|
||||
)
|
||||
for err := range errCh {
|
||||
i++
|
||||
if i == len(mp.pools) {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
var errStr strings.Builder
|
||||
for i := 0; i < len(mp.pools); i++ {
|
||||
if err := <-errCh; err != nil {
|
||||
errStr.WriteString(err.Error())
|
||||
errStr.WriteString(" | ")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue