优化限制并发的生效
This commit is contained in:
+4
-1
@@ -550,7 +550,7 @@ func (c *Cluster) executeTasks() {
|
||||
return
|
||||
case <-c.ctx.Done():
|
||||
return
|
||||
case c.workerChan <- struct{}{}:
|
||||
default:
|
||||
func() {
|
||||
|
||||
if c.usePriority && !c.priority.IsLatest(c.ctx) {
|
||||
@@ -572,6 +572,9 @@ func (c *Cluster) executeTasks() {
|
||||
return
|
||||
}
|
||||
|
||||
// 限制并发数量
|
||||
c.workerChan <- struct{}{}
|
||||
|
||||
go c.processTask(taskID[1])
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user