This commit is contained in:
huangzhenpc
2025-04-02 09:28:25 +08:00
parent 31fe73f998
commit d16f6bdc62
3 changed files with 359 additions and 70 deletions

View File

@@ -35,6 +35,8 @@ class CursorRegister:
async def initialize(self):
"""初始化数据库"""
await self.db_manager.initialize()
# 确保EmailManager完成初始化
await self.email_manager.initialize()
async def cleanup(self):
"""清理资源"""
@@ -160,6 +162,10 @@ async def main():
register.logger.info(f"当前总进度: 已注册 {total_registered} 个账号")
# 批次结束后等待3秒确保所有数据库更新都已完成
register.logger.info("本批次注册完成,等待数据库状态完全更新...")
await asyncio.sleep(3)
# 如果本批次注册失败率过高,暂停一段时间
if successful < batch_size * 0.5 and successful > 0: # 成功率低于50%但不为零
register.logger.warning("本批次成功率过低暂停60秒后继续")