优化系统goroutine使用,减少goroutine数量,增加goman查看goroutine数量指令

This commit is contained in:
GoEdgeLab
2021-12-08 15:17:45 +08:00
parent 7a2bfda436
commit 54bf0ab39d
48 changed files with 469 additions and 146 deletions

View File

@@ -29,11 +29,9 @@ func NewIPList() *IPList {
}
expireList := expires.NewList()
go func() {
expireList.StartGC(func(itemId int64) {
list.Delete(itemId)
})
}()
expireList.OnGC(func(itemId int64) {
list.Delete(itemId)
})
list.expireList = expireList
return list
}