mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 20:10:36 +00:00
🔧 avatar_list: optimize retry code
This commit is contained in:
parent
3e4cd1db1c
commit
514d1bf3b0
@ -77,13 +77,14 @@ class AvatarListPlugin(Plugin, BasePlugin):
|
|||||||
if isinstance(e, GenshinException) and "Too Many Requests" in e.msg:
|
if isinstance(e, GenshinException) and "Too Many Requests" in e.msg:
|
||||||
await asyncio.sleep(0.2)
|
await asyncio.sleep(0.2)
|
||||||
continue
|
continue
|
||||||
if character.name != "旅行者":
|
if character.name == "旅行者":
|
||||||
raise e
|
|
||||||
logger.debug(f"解析旅行者数据时遇到了错误:{e}")
|
logger.debug(f"解析旅行者数据时遇到了错误:{e}")
|
||||||
|
return None
|
||||||
|
raise e
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
if detail is None:
|
else:
|
||||||
logger.warning(f"解析[bold]{character.name}[/]的数据时遇到了错误:{e.msg}", extra={"markup": True})
|
logger.warning(f"解析[bold]{character.name}[/]的数据时遇到了 Too Many Requests 错误", extra={"markup": True})
|
||||||
return None
|
return None
|
||||||
if character.id == 10000005: # 针对男草主
|
if character.id == 10000005: # 针对男草主
|
||||||
talents = []
|
talents = []
|
||||||
|
Loading…
Reference in New Issue
Block a user