xx
This commit is contained in:
@@ -289,11 +289,12 @@ class AutoCursorService:
|
|||||||
|
|
||||||
async def start_registration_process(self):
|
async def start_registration_process(self):
|
||||||
"""启动注册进程"""
|
"""启动注册进程"""
|
||||||
|
# 如果注册进程已在运行,不做任何事
|
||||||
if self.registration_process and self.registration_process.poll() is None:
|
if self.registration_process and self.registration_process.poll() is None:
|
||||||
logger.info("注册进程已在运行中")
|
logger.info("注册进程已在运行中")
|
||||||
return
|
return
|
||||||
|
|
||||||
# 直接检查可用邮箱数量
|
# 检查可用邮箱数量
|
||||||
pending_count = await self.count_pending_accounts()
|
pending_count = await self.count_pending_accounts()
|
||||||
if pending_count < self.min_email_to_process:
|
if pending_count < self.min_email_to_process:
|
||||||
logger.warning(f"可用邮箱数量不足 ({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} 个可用邮箱,启动注册进程")
|
logger.info(f"有 {pending_count} 个可用邮箱,启动注册进程")
|
||||||
try:
|
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
|
# 使用subprocess启动main.py
|
||||||
if sys.platform.startswith("win"):
|
if sys.platform.startswith("win"):
|
||||||
self.registration_process = subprocess.Popen(
|
self.registration_process = subprocess.Popen(
|
||||||
|
|||||||
Reference in New Issue
Block a user