fix(douyu): 补齐成功后刷新和精英宝典批量选择
This commit is contained in:
@@ -302,6 +302,8 @@ class GoldMixin:
|
||||
amount=amount,
|
||||
status=2,
|
||||
balance_confirmed=True,
|
||||
cookie=cookie,
|
||||
gold_already_refreshed=bool(gold_result),
|
||||
)
|
||||
return
|
||||
if supplier_error:
|
||||
@@ -331,6 +333,8 @@ class GoldMixin:
|
||||
result,
|
||||
amount=amount,
|
||||
status=status,
|
||||
cookie=cookie,
|
||||
gold_already_refreshed=bool(gold_result),
|
||||
)
|
||||
return
|
||||
if gold_error:
|
||||
@@ -356,8 +360,29 @@ class GoldMixin:
|
||||
amount: int,
|
||||
status: int | None,
|
||||
balance_confirmed: bool = False,
|
||||
cookie: str | None = None,
|
||||
gold_already_refreshed: bool = False,
|
||||
) -> None:
|
||||
if status == 2 or balance_confirmed:
|
||||
refreshed_after_success = balance_confirmed or gold_already_refreshed
|
||||
if status == 2 and not refreshed_after_success and cookie:
|
||||
try:
|
||||
result.update(
|
||||
self._refresh_account_gold_balance(
|
||||
self._client(cookie, direct=True),
|
||||
account,
|
||||
)
|
||||
)
|
||||
refreshed_after_success = True
|
||||
self._push_log(
|
||||
"info",
|
||||
"供应商直充成功,已刷新鱼翅余额: "
|
||||
f"{account.gold_balance if account.gold_balance is not None else '-'}",
|
||||
)
|
||||
except Exception as exc: # noqa: BLE001 充值成功后刷新失败不翻盘
|
||||
result["gold_refresh_after_success_error"] = str(exc)
|
||||
self._push_log("warning", f"供应商直充成功后刷新鱼翅失败: {exc}")
|
||||
result["gold_refreshed_after_success"] = refreshed_after_success
|
||||
account.updated_at = datetime.now(UTC)
|
||||
record_recharge(
|
||||
db,
|
||||
@@ -573,6 +598,7 @@ class GoldMixin:
|
||||
result,
|
||||
amount=amount,
|
||||
status=status,
|
||||
cookie=cookie,
|
||||
)
|
||||
return
|
||||
self._schedule_payment_poll(
|
||||
|
||||
Reference in New Issue
Block a user