This commit is contained in:
huangzhenpc
2025-04-01 17:39:22 +08:00
parent 6d618d36ac
commit 2390592bb2

View File

@@ -289,11 +289,12 @@ class AutoCursorService:
async def start_registration_process(self):
"""启动注册进程"""
# 如果注册进程已在运行,不做任何事
if self.registration_process and self.registration_process.poll() is None:
logger.info("注册进程已在运行中")
return
# 直接检查可用邮箱数量
# 检查可用邮箱数量
pending_count = await self.count_pending_accounts()
if pending_count < self.min_email_to_process:
logger.warning(f"可用邮箱数量不足 ({pending_count} < {self.min_email_to_process}),暂不启动注册进程")
@@ -301,6 +302,13 @@ class AutoCursorService:
logger.info(f"{pending_count} 个可用邮箱,启动注册进程")
try:
# 获取配置中的batch_size确保并发注册
batch_size = 1 # 默认值
if hasattr(self.config, "register_config") and self.config.register_config:
batch_size = getattr(self.config.register_config, "batch_size", 1)
logger.info(f"注册批次大小设置为: {batch_size}")
# 使用subprocess启动main.py
if sys.platform.startswith("win"):
self.registration_process = subprocess.Popen(