update default settings of pool

This commit is contained in:
Andy Pan 2018-08-04 10:49:07 +08:00
parent 76cc065dbc
commit 7f82498abc
1 changed files with 1 additions and 11 deletions

12
ants.go
View File

@ -35,18 +35,8 @@ const (
DefaultCleanIntervalTime = 10
)
var (
defaultAntsPool *Pool
err error
)
// Init a instance pool when importing ants
func init() {
defaultAntsPool, err = NewPool(DefaultAntsPoolSize)
if err != nil {
panic(err)
}
}
var defaultAntsPool, _ = NewPool(DefaultAntsPoolSize)
// Submit submit a task to pool
func Submit(task f) error {