refactor(backend): optimize database safety, validator performance, and scheduler concurrency
- Fix SQL injection risks in proxy_repo and task_repo - Atomic acquire_pending with UPDATE ... RETURNING - Reuse aiohttp ClientSession in ValidatorService - Replace polling with asyncio.Event in SchedulerService - Optimize ValidationQueue.drain with asyncio.Condition - Concurrent plugin crawling with asyncio.gather - Unify ProxyRaw model import path - Fix test baseline and remove tracked __pycache__ files
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -121,14 +121,14 @@ class TestProxiesAPI:
|
||||
"""测试 GET /api/proxies/export/csv"""
|
||||
response = await client.get("/api/proxies/export/csv")
|
||||
assert response.status_code == 200
|
||||
assert response.headers["content-type"] == "text/csv"
|
||||
assert response.headers["content-type"].startswith("text/csv")
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_export_proxies_txt(self, client):
|
||||
"""测试 GET /api/proxies/export/txt"""
|
||||
response = await client.get("/api/proxies/export/txt")
|
||||
assert response.status_code == 200
|
||||
assert response.headers["content-type"] == "text/plain"
|
||||
assert response.headers["content-type"].startswith("text/plain")
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_export_proxies_json(self, client):
|
||||
|
||||
Reference in New Issue
Block a user