From 2390592bb253debeaa15dd92d0a27d5192d15ca7 Mon Sep 17 00:00:00 2001 From: huangzhenpc Date: Tue, 1 Apr 2025 17:39:22 +0800 Subject: [PATCH] xx --- auto_cursor_service.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/auto_cursor_service.py b/auto_cursor_service.py index feabdfb..7c1df02 100644 --- a/auto_cursor_service.py +++ b/auto_cursor_service.py @@ -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(