执行 Ruff 安全自动修复
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import csv
|
||||
import uuid
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
@@ -13,7 +13,6 @@ from core.huya.cookie_utils import cookie_value, normalize_huya_cookie
|
||||
from ..huya_defaults import HUYA_CONFIG_DEFAULTS, HUYA_CONFIG_FIELDS
|
||||
from ..models import HuyaAccount, HuyaConfig, HuyaTask
|
||||
|
||||
|
||||
SUPPORTED_TASK_TYPES = {
|
||||
"get_bind_qr": "获取绑定二维码",
|
||||
"query_points": "一键查询积分",
|
||||
@@ -204,7 +203,7 @@ def import_huya_password_accounts(
|
||||
account.tag = tag
|
||||
if not account.cookie:
|
||||
account.status = "password_imported"
|
||||
account.updated_at = datetime.now(timezone.utc)
|
||||
account.updated_at = datetime.now(UTC)
|
||||
created_or_updated += 1
|
||||
|
||||
if created_or_updated:
|
||||
@@ -247,7 +246,7 @@ def _upsert_huya_account(
|
||||
if tag:
|
||||
account.tag = tag
|
||||
account.status = status or "updated"
|
||||
account.updated_at = datetime.now(timezone.utc)
|
||||
account.updated_at = datetime.now(UTC)
|
||||
return account
|
||||
|
||||
|
||||
@@ -276,7 +275,7 @@ def save_huya_login_cookie_to_account(
|
||||
if tag:
|
||||
account.tag = tag
|
||||
account.status = "login_success"
|
||||
account.updated_at = datetime.now(timezone.utc)
|
||||
account.updated_at = datetime.now(UTC)
|
||||
db.commit()
|
||||
db.refresh(account)
|
||||
return account
|
||||
@@ -358,7 +357,7 @@ def cleanup_orphan_huya_tasks(
|
||||
if not tasks:
|
||||
return 0
|
||||
|
||||
now = datetime.now(timezone.utc)
|
||||
now = datetime.now(UTC)
|
||||
for task in tasks:
|
||||
task.status = "stopped"
|
||||
task.message = message
|
||||
|
||||
Reference in New Issue
Block a user