ci增加重传机制 (#410)

This commit is contained in:
UUBulb 2024-08-18 08:56:52 +08:00 committed by GitHub
parent e9428d5757
commit 9c986d06cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

4
.github/sync.py vendored
View File

@ -97,6 +97,9 @@ def sync_to_gitee(tag: str, body: str, files: slice):
asset_api_uri = f"{release_api_uri}/{release_id}/attach_files" asset_api_uri = f"{release_api_uri}/{release_id}/attach_files"
for file_path in files: for file_path in files:
success = False
while not success:
files = { files = {
'file': open(file_path, 'rb') 'file': open(file_path, 'rb')
} }
@ -108,6 +111,7 @@ def sync_to_gitee(tag: str, body: str, files: slice):
asset_info = asset_api_response.json() asset_info = asset_api_response.json()
asset_name = asset_info.get('name') asset_name = asset_info.get('name')
print(f"Successfully uploaded {asset_name}!") print(f"Successfully uploaded {asset_name}!")
success = True
else: else:
print( print(
f"Request failed with status code {asset_api_response.status_code}") f"Request failed with status code {asset_api_response.status_code}")