style: 修复2个文件ruff告警+格式化对齐(smart_asset_selector + test_ai_service)
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 19s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 46s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m18s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m34s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 27s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 4m42s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m39s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 11s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 4m6s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 3m23s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 24s
AI Code Review / AI Code Review (pull_request) Successful in 5m42s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 4m32s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 7m13s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 13m25s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1317h29m13s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 1317h29m17s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1317h29m19s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1317h31m20s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1317h31m22s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 1317h31m42s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 1317h31m46s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1317h31m48s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1317h35m11s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1317h35m7s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1318h7m30s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 1318h4m5s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1318h1m36s

This commit is contained in:
2026-07-23 17:51:37 +08:00
parent 8cec4069fa
commit 407261cf51
2 changed files with 22 additions and 25 deletions
@@ -18,7 +18,6 @@
from __future__ import annotations
import logging
import math
from dataclasses import dataclass
logger = logging.getLogger(__name__)
@@ -278,9 +277,7 @@ class SmartAssetSelector:
# 分桶
short_bucket = [d for d in scored if d.duration is not None and d.duration < _SHORT_BUCKET_MAX]
medium_bucket = [
d
for d in scored
if d.duration is not None and _SHORT_BUCKET_MAX <= d.duration < _MEDIUM_BUCKET_MAX
d for d in scored if d.duration is not None and _SHORT_BUCKET_MAX <= d.duration < _MEDIUM_BUCKET_MAX
]
long_bucket = [d for d in scored if d.duration is not None and d.duration >= _MEDIUM_BUCKET_MAX]
unknown_bucket = [d for d in scored if d.duration is None]
@@ -295,7 +292,7 @@ class SmartAssetSelector:
selected_ids: set[str] = set()
# 先按配额从每个桶取
for bucket, name in zip(buckets, bucket_names):
for bucket, _name in zip(buckets, bucket_names, strict=False):
quota = min(base_quota, len(bucket))
if quota <= 0:
continue