mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
fix(antigravity): add 30s timeout for TestConnection retry loop
Prevents MODEL_CAPACITY_EXHAUSTED 60x1s retries from blocking test connection for up to 60 seconds. Context timeout ensures the test connection returns within a reasonable time.
This commit is contained in:
@@ -1043,8 +1043,13 @@ func (s *AntigravityGatewayService) TestConnection(ctx context.Context, account
|
||||
|
||||
// 复用 antigravityRetryLoop:完整的重试 / credits overages / 智能重试
|
||||
prefix := fmt.Sprintf("[antigravity-Test] account=%d(%s)", account.ID, account.Name)
|
||||
// 限制测试连接的总超时:避免 MODEL_CAPACITY_EXHAUSTED 60 次重试导致长时间阻塞
|
||||
const testConnectionTimeout = 30 * time.Second
|
||||
testCtx, cancel := context.WithTimeout(ctx, testConnectionTimeout)
|
||||
defer cancel()
|
||||
|
||||
p := antigravityRetryLoopParams{
|
||||
ctx: ctx,
|
||||
ctx: testCtx,
|
||||
prefix: prefix,
|
||||
account: account,
|
||||
proxyURL: proxyURL,
|
||||
|
||||
Reference in New Issue
Block a user