feat: 优化key验证流程

This commit is contained in:
tbphp
2025-07-13 23:21:50 +08:00
parent 411f8f2e78
commit 1a800dd452
6 changed files with 112 additions and 53 deletions

View File

@@ -70,8 +70,7 @@ func (s *KeyManualValidationService) runValidation(group *models.Group, keys []m
jobs := make(chan models.APIKey, len(keys))
results := make(chan bool, len(keys))
// 固定10并发避免超频
concurrency := 10
concurrency := group.EffectiveConfig.KeyValidationConcurrency
var wg sync.WaitGroup
for range concurrency {
@@ -84,7 +83,6 @@ func (s *KeyManualValidationService) runValidation(group *models.Group, keys []m
}
close(jobs)
// Wait for all workers to complete in a separate goroutine
go func() {
wg.Wait()
close(results)