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()
|
_ = wg.Wait()
|
||||||
|
|
||||||
var (
|
var errStr strings.Builder
|
||||||
i int
|
for i := 0; i < len(mp.pools); i++ {
|
||||||
errStr strings.Builder
|
if err := <-errCh; err != nil {
|
||||||
)
|
|
||||||
for err := range errCh {
|
|
||||||
i++
|
|
||||||
if i == len(mp.pools) {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
errStr.WriteString(err.Error())
|
errStr.WriteString(err.Error())
|
||||||
errStr.WriteString(" | ")
|
errStr.WriteString(" | ")
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,16 +191,9 @@ func (mp *MultiPoolWithFunc) ReleaseTimeout(timeout time.Duration) error {
|
||||||
|
|
||||||
_ = wg.Wait()
|
_ = wg.Wait()
|
||||||
|
|
||||||
var (
|
var errStr strings.Builder
|
||||||
i int
|
for i := 0; i < len(mp.pools); i++ {
|
||||||
errStr strings.Builder
|
if err := <-errCh; err != nil {
|
||||||
)
|
|
||||||
for err := range errCh {
|
|
||||||
i++
|
|
||||||
if i == len(mp.pools) {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
errStr.WriteString(err.Error())
|
errStr.WriteString(err.Error())
|
||||||
errStr.WriteString(" | ")
|
errStr.WriteString(" | ")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue