代码优化
This commit is contained in:
parent
77a6008697
commit
3330f60ffc
|
|
@ -70,11 +70,12 @@ class DealAccount:
|
||||||
async def deal_backup_task(self, data: Dict[str, Any]):
|
async def deal_backup_task(self, data: Dict[str, Any]):
|
||||||
# 先查询该账户是否备份过,备份过就修改数据库状态,
|
# 先查询该账户是否备份过,备份过就修改数据库状态,
|
||||||
await self.db_pool.initialize()
|
await self.db_pool.initialize()
|
||||||
set_param = {"status": 1, "update_time": datetime.now().strftime("%Y-%m-%d %H:%M:%S")}
|
set_param = {"status": 1}
|
||||||
params = (data["account_id"],)
|
params = (data["account_id"],)
|
||||||
where_conditions = "account_id = %s "
|
where_conditions = "account_id = %s "
|
||||||
result = await self.update_device_status(set_param, where_conditions, params)
|
result = await self.update_device_status(set_param, where_conditions, params)
|
||||||
if result:
|
print(result)
|
||||||
|
if not result:
|
||||||
print(f"该账号:{data['account_id']} 已经备份过,不需要在备份")
|
print(f"该账号:{data['account_id']} 已经备份过,不需要在备份")
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue