feat(automation): 持久执行队列与重复充值确认
This commit is contained in:
@@ -21,7 +21,11 @@ from ..account_binding import (
|
||||
pending_binding_role_from_result,
|
||||
)
|
||||
from ..business_events import record_douyu_task_started
|
||||
from ..douyu_batch_launcher import start_douyu_batch
|
||||
from ..execution_jobs import (
|
||||
JOB_DOUYU_BINDING,
|
||||
LANE_FULFILLMENT,
|
||||
enqueue_execution_job,
|
||||
)
|
||||
from .binding_status import (
|
||||
_binding_failure_issue,
|
||||
_binding_failure_raw_message,
|
||||
@@ -129,14 +133,21 @@ def start_binding_sync(
|
||||
detail={"bindTaskId": bind_task.id},
|
||||
)
|
||||
_emit_order_site_binding_state(db, task.id)
|
||||
db.commit()
|
||||
start_douyu_batch(
|
||||
enqueue_execution_job(
|
||||
db,
|
||||
job_type=JOB_DOUYU_BINDING,
|
||||
lane_scope=LANE_FULFILLMENT,
|
||||
batch_id=batch_id,
|
||||
task_type="get_bind_qr",
|
||||
payload={},
|
||||
concurrency=1,
|
||||
capture_event_loop=False,
|
||||
payload={
|
||||
"task_type": "get_bind_qr",
|
||||
"payload": {},
|
||||
"concurrency": 1,
|
||||
},
|
||||
created_by=int(current.id),
|
||||
priority=10,
|
||||
max_attempts=2,
|
||||
)
|
||||
db.commit()
|
||||
return get_task_detail(db, task.id)
|
||||
|
||||
|
||||
@@ -368,14 +379,21 @@ def confirm_binding_sync(db: Session, *, task_id: int, current: User) -> dict[st
|
||||
detail={"confirmTaskId": confirm_task.id},
|
||||
)
|
||||
_emit_order_site_binding_state(db, task.id)
|
||||
db.commit()
|
||||
start_douyu_batch(
|
||||
enqueue_execution_job(
|
||||
db,
|
||||
job_type=JOB_DOUYU_BINDING,
|
||||
lane_scope=LANE_FULFILLMENT,
|
||||
batch_id=batch_id,
|
||||
task_type="confirm_bind",
|
||||
payload={},
|
||||
concurrency=1,
|
||||
capture_event_loop=False,
|
||||
payload={
|
||||
"task_type": "confirm_bind",
|
||||
"payload": {},
|
||||
"concurrency": 1,
|
||||
},
|
||||
created_by=int(current.id),
|
||||
priority=10,
|
||||
max_attempts=1,
|
||||
)
|
||||
db.commit()
|
||||
return get_task_detail(db, task.id)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user