Skip to content

Commit

Permalink
hermetic: retry on failed network requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean authored and praiskup committed Nov 27, 2024
1 parent 8728df1 commit cb2834b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mock/py/mock-hermetic-repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The mock-hermetic-repo command now implements a retry mechanism for downloading files.

0 comments on commit cb2834b

Please sign in to comment.