diff --git a/account_management/deal_account.py b/account_management/deal_account.py index 9170057..1b101c8 100644 --- a/account_management/deal_account.py +++ b/account_management/deal_account.py @@ -114,6 +114,7 @@ class DealAccount: # 下载执行脚本 self.task_all.upload_file_to_phone([data["pad_code"]], file_name=res_dict["script_name"]) # 设置代理 + print(data) self.task_all.set_network_proxy(pad_code=[data["pad_code"]],country=data["country"]) # 启动对应脚本 self.task_all.async_execute_adb_command(pad_code=data["pad_code"], file_name=res_dict["script_name"]) diff --git a/main.py b/main.py index 928a7fc..f02b35b 100644 --- a/main.py +++ b/main.py @@ -221,21 +221,24 @@ async def shop_backup(backup_data: BackupItem, account_manager: Any = Depends(ge pad_code """ param = backup_data.model_dump() - try: - result = await account_manager.deal_backup_task(param) - if param.get("is_restore", False): - time.sleep(random.randint(1, 10)) - restore_result = await account_manager.deal_restore_system(param) - if restore_result and result: - return {"code": 200, "message": f"任务:{param.get("pad_code")} 备份还原成功"} - raise HTTPException(status_code=404, detail=f"云机:{param.get("pad_code")} 备份还原失败") + print(param) + result = await account_manager.deal_backup_task(param) + if param.get("is_restore", False): + time.sleep(random.randint(1, 10)) + print(param) + restore_result = await account_manager.deal_restore_system(param) + if restore_result and result: + return {"code": 200, "message": f"任务:{param.get("pad_code")} 备份还原成功"} + raise HTTPException(status_code=404, detail=f"云机:{param.get("pad_code")} 备份还原失败") + else: + if result: + return {"code": 200, "message": f"任务:{param.get("pad_code")} 备份成功", } else: - if result: - return {"code": 200, "message": f"任务:{param.get("pad_code")} 备份成功", } - else: - raise HTTPException(status_code=404, detail=f"云机:{param.get("pad_code")} 备份失败") - except Exception as e: - raise HTTPException(status_code=404, detail=f"云机:{param.get("pad_code")} 备份失败,失败原因:{e}") + raise HTTPException(status_code=404, detail=f"云机:{param.get("pad_code")} 备份失败") + # try: + # pass + # except Exception as e: + # raise HTTPException(status_code=404, detail=f"云机:{param.get("pad_code")} 备份失败,失败原因:{e}") if __name__ == '__main__': diff --git a/model/model.py b/model/model.py index eb833b9..010c135 100644 --- a/model/model.py +++ b/model/model.py @@ -59,3 +59,4 @@ class BackupItem(BaseModel): account_id: str = Field(..., description="账号ID") script_name: str = Field(..., description="脚本名称") is_restore: bool = Field(..., description="是否还原") + country: bool = Field(..., description="国家") diff --git a/public_function/deal_all_task.py b/public_function/deal_all_task.py index aa757aa..3781f29 100644 --- a/public_function/deal_all_task.py +++ b/public_function/deal_all_task.py @@ -138,6 +138,7 @@ class DealAllTask: def check_phone_status(self, pad_code: list[str], file_name: str,times=10): count = 0 + time.sleep(300) while True: result = self.async_execute_adb_command(pad_code, file_name, is_check=True) if result: