fix(douyu): coordinate collab and platform account leases
Avoid automatic allocation of accounts with active external collaboration, require explicit manual takeover of platform leases, and add Douyu account identity search.
This commit is contained in:
@@ -344,9 +344,19 @@ def _lock_payment_accounts(
|
||||
if account is not None
|
||||
else f"#{conflict.account_id}"
|
||||
)
|
||||
task_label = SUPPORTED_DOUYU_TASK_TYPES.get(
|
||||
str(conflict.task_type or ""),
|
||||
"斗鱼付费任务",
|
||||
)
|
||||
status_label = {
|
||||
"planned": "已创建,等待执行",
|
||||
"pending": "正在排队等待执行",
|
||||
"running": "正在执行",
|
||||
}.get(conflict.status, "仍在处理中")
|
||||
raise DouyuActivePaymentError(
|
||||
f"账号 {label} 已有充值任务处理中(批次 {conflict.batch_id}),"
|
||||
"请先完成或停止该充值"
|
||||
f"账号 {label} 的「{task_label}」{status_label}"
|
||||
f"(批次 {conflict.batch_id})。为避免同账号二维码或支付会话串单,"
|
||||
"请等待任务结束;若长时间未结束,请联系批次创建人或管理员停止后再试"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user