allow retry on connection loss
This commit is contained in:
14
.github/workflows/generator-android.yml
vendored
14
.github/workflows/generator-android.yml
vendored
@@ -87,9 +87,21 @@ jobs:
|
|||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
import time
|
||||||
|
|
||||||
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}')
|
for attempt in range(5):
|
||||||
|
try:
|
||||||
|
print(f"Downloading secrets (Attempt {attempt + 1})...")
|
||||||
|
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}', timeout=60)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
break
|
||||||
|
except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
|
||||||
|
if attempt < 4:
|
||||||
|
print(f"Timeout/Error occurred: {e}. Retrying in 5 seconds...")
|
||||||
|
time.sleep(5)
|
||||||
|
else:
|
||||||
|
print("Max retries reached. Failing.")
|
||||||
|
raise e
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
|
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
|
||||||
|
|||||||
15
.github/workflows/generator-windows-x86.yml
vendored
15
.github/workflows/generator-windows-x86.yml
vendored
@@ -2,7 +2,6 @@ name: Custom Windows x86 Client Generator
|
|||||||
run-name: Custom Windows x86 Client Generator
|
run-name: Custom Windows x86 Client Generator
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: 'version to buld'
|
description: 'version to buld'
|
||||||
@@ -77,9 +76,21 @@ jobs:
|
|||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
import time
|
||||||
|
|
||||||
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}')
|
for attempt in range(5):
|
||||||
|
try:
|
||||||
|
print(f"Downloading secrets (Attempt {attempt + 1})...")
|
||||||
|
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}', timeout=60)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
break
|
||||||
|
except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
|
||||||
|
if attempt < 4:
|
||||||
|
print(f"Timeout/Error occurred: {e}. Retrying in 5 seconds...")
|
||||||
|
time.sleep(5)
|
||||||
|
else:
|
||||||
|
print("Max retries reached. Failing.")
|
||||||
|
raise e
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
|
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
|
||||||
|
|||||||
14
.github/workflows/generator-windows.yml
vendored
14
.github/workflows/generator-windows.yml
vendored
@@ -87,9 +87,21 @@ jobs:
|
|||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
import time
|
||||||
|
|
||||||
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}')
|
for attempt in range(5):
|
||||||
|
try:
|
||||||
|
print(f"Downloading secrets (Attempt {attempt + 1})...")
|
||||||
|
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}', timeout=60)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
break
|
||||||
|
except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
|
||||||
|
if attempt < 4:
|
||||||
|
print(f"Timeout/Error occurred: {e}. Retrying in 5 seconds...")
|
||||||
|
time.sleep(5)
|
||||||
|
else:
|
||||||
|
print("Max retries reached. Failing.")
|
||||||
|
raise e
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
|
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
|
||||||
|
|||||||
Reference in New Issue
Block a user