123456789101112131415161718192021222324 |
- package init
- import "log"
- func NoLoginPoolInit(poolSwitch bool, do, wait int) {
- if poolSwitch {
- //创建执行池 等待池
- doPool := make(chan struct{}, do)
- for i := 0; i < do; i++ {
- doPool <- struct{}{}
- }
- waitPool := make(chan struct{}, wait)
- for i := 0; i < wait; i++ {
- waitPool <- struct{}{}
- }
- ReqLimitInit = &ReqLimit{
- DoPool: doPool,
- WaitPool: waitPool,
- }
- } else {
- log.Println("未登录搜索限制未打开")
- }
- }
|