fix: 天气查询失败的问题

This commit is contained in:
远野千束 2024-04-15 20:46:09 +08:00
parent 016fe3ef72
commit c4db4dc6a6

View File

@ -27,14 +27,15 @@ def update_liteyuki() -> tuple[bool, str]:
logs = ""
# 对每个远程仓库进行更新
for remote_url in remote_urls:
logs += f"\nremote: {remote_url}"
repo.remotes.origin.set_url(remote_url)
repo.remotes.origin.pull()
diffs = repo.head.commit.diff("origin/main")
for diff in diffs.iter_change_type('M'):
logs += f"\n{diff.a_path}"
return True, logs
try:
logs += f"\nremote: {remote_url}"
repo.remotes.origin.set_url(remote_url)
repo.remotes.origin.pull()
diffs = repo.head.commit.diff("origin/main")
for diff in diffs.iter_change_type('M'):
logs += f"\n{diff.a_path}"
return True, logs
except:
continue
else:
return False, "Nothing Changed"