fix(ruff): 移除可变 ContextVar 默认值(B039),_dbg 改为 logger.debug
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 0s
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / Check push changed paths (push) Successful in 9s
CI/CD Pipeline / Build Staging API Image (push) Successful in 2m14s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 2m15s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 3m25s
CI/CD Pipeline / Integration Tests (push) Successful in 9m35s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 12m47s
CI/CD Pipeline / Validate - Style (push) Failing after 12m55s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 15m47s
CI/CD Pipeline / Retag skipped Staging API Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Unit Tests (push) Successful in 15m59s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m42s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m33s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 1m39s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 2m47s
CI/CD Pipeline / Validate - Security (push) Successful in 26m7s
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Canary Release to Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 0s
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / Check push changed paths (push) Successful in 9s
CI/CD Pipeline / Build Staging API Image (push) Successful in 2m14s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 2m15s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 3m25s
CI/CD Pipeline / Integration Tests (push) Successful in 9m35s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 12m47s
CI/CD Pipeline / Validate - Style (push) Failing after 12m55s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 15m47s
CI/CD Pipeline / Retag skipped Staging API Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Unit Tests (push) Successful in 15m59s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m42s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m33s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 1m39s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 2m47s
CI/CD Pipeline / Validate - Security (push) Successful in 26m7s
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Canary Release to Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
This commit is contained in:
@@ -12,11 +12,6 @@ import logging
|
||||
import os
|
||||
import re
|
||||
import tempfile
|
||||
from contextvars import ContextVar
|
||||
|
||||
# 抖音提取调试信息(单次请求上下文,用于排查 yt-dlp/cookies 问题)
|
||||
_douyin_debug: ContextVar[dict] = ContextVar("_douyin_debug", default={})
|
||||
|
||||
from app.auth import AuthenticatedUser, get_current_user
|
||||
from app.dependencies import get_db_session
|
||||
from app.schemas.scripts_ai import (
|
||||
@@ -82,11 +77,8 @@ def _cookies_file_exists() -> bool:
|
||||
|
||||
|
||||
def _dbg(key: str, val: str) -> None:
|
||||
"""记录抖音调试信息(会被中间件写入 X-Douyin-Debug-* 响应头)。"""
|
||||
try:
|
||||
_douyin_debug.get()[key] = str(val)[:200]
|
||||
except Exception:
|
||||
pass
|
||||
"""记录抖音调试信息(debug 日志)。"""
|
||||
logger.debug("douyin_extract %s=%s", key, str(val)[:200])
|
||||
|
||||
|
||||
def _is_cookies_related_error(msg: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user