Apparently github's deletion api is flakey, retry
This commit is contained in:
parent
fd7cc66689
commit
c6dd6ccc68
@ -285,6 +285,7 @@ class GitHub(Base): # {{{
|
|||||||
upload_url = release['upload_url'].partition('{')[0]
|
upload_url = release['upload_url'].partition('{')[0]
|
||||||
asset_url = f'{self.url_base}/assets/{{}}'
|
asset_url = f'{self.url_base}/assets/{{}}'
|
||||||
existing_assets = self.existing_assets(release['id'])
|
existing_assets = self.existing_assets(release['id'])
|
||||||
|
original_existing_assets = existing_assets.copy()
|
||||||
|
|
||||||
def delete_asset(asset_id: str) -> None:
|
def delete_asset(asset_id: str) -> None:
|
||||||
r = self.requests.delete(asset_url.format(asset_id))
|
r = self.requests.delete(asset_url.format(asset_id))
|
||||||
@ -317,10 +318,9 @@ class GitHub(Base): # {{{
|
|||||||
try:
|
try:
|
||||||
asset_id = r.json()['id']
|
asset_id = r.json()['id']
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
asset_id = original_existing_assets[fname]
|
||||||
else:
|
self.info(f'Deleting {fname} from GitHub with id: {asset_id}')
|
||||||
self.info(f'Deleting {fname} from GitHub with id: {asset_id}')
|
delete_asset(asset_id)
|
||||||
delete_asset(asset_id)
|
|
||||||
time.sleep(sleep_time)
|
time.sleep(sleep_time)
|
||||||
|
|
||||||
if self.is_nightly:
|
if self.is_nightly:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user