feat(automation): 持久执行队列与重复充值确认
This commit is contained in:
@@ -1755,8 +1755,8 @@ class TestBindingAndCompletion(_Base):
|
||||
self.session.commit()
|
||||
monkeypatch.setattr(
|
||||
service.binding,
|
||||
"start_douyu_batch",
|
||||
lambda **_kwargs: None,
|
||||
"enqueue_execution_job",
|
||||
lambda _db, **_kwargs: None,
|
||||
)
|
||||
|
||||
asyncio.run(
|
||||
@@ -1822,8 +1822,8 @@ class TestBindingAndCompletion(_Base):
|
||||
task = self._allocated()
|
||||
monkeypatch.setattr(
|
||||
service.binding,
|
||||
"start_douyu_batch",
|
||||
lambda **_kwargs: None,
|
||||
"enqueue_execution_job",
|
||||
lambda _db, **_kwargs: None,
|
||||
)
|
||||
|
||||
first = asyncio.run(service.customer_start_binding(self.session, task_id=task.id))
|
||||
@@ -1848,21 +1848,21 @@ class TestBindingAndCompletion(_Base):
|
||||
captured: dict[str, object] = {}
|
||||
monkeypatch.setattr(
|
||||
service.binding,
|
||||
"start_douyu_batch",
|
||||
lambda **kwargs: captured.update(kwargs),
|
||||
"enqueue_execution_job",
|
||||
lambda _db, **kwargs: captured.update(kwargs),
|
||||
)
|
||||
|
||||
asyncio.run(service.customer_start_binding(self.session, task_id=task.id))
|
||||
|
||||
assert captured["capture_event_loop"] is False
|
||||
assert "loop" not in captured
|
||||
assert captured["job_type"] == "douyu_binding"
|
||||
assert captured["batch_id"].startswith(f"pfbind-{task.id}-")
|
||||
|
||||
def test_concurrent_start_binding_creates_one_task(self, monkeypatch):
|
||||
task = self._allocated()
|
||||
monkeypatch.setattr(
|
||||
service.binding,
|
||||
"start_douyu_batch",
|
||||
lambda **_kwargs: None,
|
||||
"enqueue_execution_job",
|
||||
lambda _db, **_kwargs: None,
|
||||
)
|
||||
barrier = threading.Barrier(2)
|
||||
errors: list[BaseException] = []
|
||||
@@ -1936,8 +1936,8 @@ class TestBindingAndCompletion(_Base):
|
||||
self.session.commit()
|
||||
monkeypatch.setattr(
|
||||
service.binding,
|
||||
"start_douyu_batch",
|
||||
lambda **_kwargs: None,
|
||||
"enqueue_execution_job",
|
||||
lambda _db, **_kwargs: None,
|
||||
)
|
||||
|
||||
asyncio.run(
|
||||
@@ -2457,8 +2457,8 @@ class TestBindingAndCompletion(_Base):
|
||||
self.session.commit()
|
||||
monkeypatch.setattr(
|
||||
service.binding,
|
||||
"start_douyu_batch",
|
||||
lambda **_kwargs: None,
|
||||
"enqueue_execution_job",
|
||||
lambda _db, **_kwargs: None,
|
||||
)
|
||||
|
||||
asyncio.run(
|
||||
|
||||
Reference in New Issue
Block a user