diff --git a/mock/py/mock-hermetic-repo.py b/mock/py/mock-hermetic-repo.py index 9410e611a..12fc75a1f 100755 --- a/mock/py/mock-hermetic-repo.py +++ b/mock/py/mock-hermetic-repo.py @@ -15,14 +15,18 @@ import shutil import subprocess import sys + from urllib.parse import quote +import backoff import requests logging.basicConfig(level=logging.DEBUG) log = logging.getLogger(__name__) +@backoff.on_exception(backoff.expo, requests.exceptions.RequestException, + max_tries=5, max_time=300) def download_file(url, outputdir): """ Download a single file (pool worker) diff --git a/releng/release-notes-next/hermetic-download-retry.bugfix.md b/releng/release-notes-next/hermetic-download-retry.bugfix.md new file mode 100644 index 000000000..25fb4479b --- /dev/null +++ b/releng/release-notes-next/hermetic-download-retry.bugfix.md @@ -0,0 +1 @@ +The mock-hermetic-repo command now implements a retry mechanism for downloading files.