fix(deploy): 优化大表迁移并修复后台事件循环

This commit is contained in:
yml
2026-11-20 22:11:54 +08:00
parent 071d45ad1d
commit 409e22be90
7 changed files with 28 additions and 5 deletions
+14
View File
@@ -1464,6 +1464,20 @@ class TestBindingAndCompletion(_Base):
self.session.refresh(task)
assert task.bind_task_id == bind_tasks[0].id
def test_customer_started_binding_does_not_capture_request_loop(self, monkeypatch):
task = self._allocated()
captured: dict[str, object] = {}
monkeypatch.setattr(
service,
"start_douyu_batch",
lambda **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
def test_concurrent_start_binding_creates_one_task(self, monkeypatch):
task = self._allocated()
monkeypatch.setattr(service, "start_douyu_batch", lambda **_kwargs: None)