优化限制并发的生效

This commit is contained in:
Yun
2026-05-27 14:53:26 +08:00
parent ed326b192d
commit ee90cf2e36
2 changed files with 9 additions and 3 deletions
+4 -1
View File
@@ -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])
}()
}