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:
祀梦
2026-04-04 14:43:31 +08:00
parent abb8b32ed3
commit 635c524a7e
27 changed files with 103 additions and 89 deletions

View File

@@ -7,6 +7,7 @@ from app.core.log import logger
class Ip89Plugin(BaseHTTPPlugin):
default_config = {"max_pages": 5}
name = "ip89"
display_name = "89免费代理"
description = "从 89ip.cn 爬取免费代理"
@@ -35,5 +36,5 @@ class Ip89Plugin(BaseHTTPPlugin):
results.append(ProxyRaw(ip, int(port), "http"))
if results:
logger.info(f"{self.display_name} 解析完成,获 {len(results)} 个潜在代理")
logger.info(f"{self.display_name} 解析完成,获 {len(results)} 个潜在代理")
return results