perf(douyu): 拆分支付轮询并扩展查询并发

This commit is contained in:
yml
2026-11-21 10:38:39 +08:00
parent 743fa69630
commit 3987464035
21 changed files with 1151 additions and 531 deletions
+15
View File
@@ -120,6 +120,21 @@ class TestDouyuProxyMode:
)
assert runner._proxies_for_task() is None
def test_payment_poll_direct_client_does_not_fetch_proxy(self):
runner = _runner(
_cfg(enabled=True, api_url="https://proxy-api.example/fetch"),
task_type="create_elite_qr",
)
runner._proxy_fetcher = Mock()
runner._proxy_fetcher.fetch_new_proxy.side_effect = AssertionError(
"支付到账轮询不应取代理"
)
client = runner._client("acf_uid=100", direct=True)
assert client.session.proxies == {}
runner._proxy_fetcher.fetch_new_proxy.assert_not_called()
def test_proxy_task_types_covers_all_write_tasks(self):
"""白名单集合应覆盖全部会消耗/下单的写操作任务,且不含查询类。"""
assert "exchange_goods" in DOUYU_PROXY_TASK_TYPES