fix: fail user notice

This commit is contained in:
xtaodada 2023-12-12 13:40:23 +08:00
parent 254a0d22e7
commit b9ad65b01b
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -120,7 +120,7 @@ async def async_get_user(user_data: Dict, username: str) -> None:
logs.warning(f"获取 {username} 的数据失败,未知原因") logs.warning(f"获取 {username} 的数据失败,未知原因")
except UsernameNotFound: except UsernameNotFound:
logs.warning(f"获取 {username} 的数据失败,可能用户名已改变") logs.warning(f"获取 {username} 的数据失败,可能用户名已改变")
user_data[username] = UsernameNotFound user_data[username] = UsernameNotFound()
except Exception: except Exception:
logs.error(f"获取 {username} 的数据失败") logs.error(f"获取 {username} 的数据失败")
user_data[username] = None user_data[username] = None
@ -152,6 +152,9 @@ async def check_update():
elif isinstance(user_data, UsernameNotFound): elif isinstance(user_data, UsernameNotFound):
logs.warning(f"获取 {username} 的数据失败,可能用户名已改变") logs.warning(f"获取 {username} 的数据失败,可能用户名已改变")
failed_users.append(username) failed_users.append(username)
else:
logs.error(f"获取 {username} 的数据失败,未知原因")
failed_users.append(username)
if check: if check:
logs.info(f"处理完成,剩余 {nums - idx - 1} 个用户") logs.info(f"处理完成,剩余 {nums - idx - 1} 个用户")
if len(failed_users) > 5: if len(failed_users) > 5: