Skip to content

Commit

Permalink
max retry of 7.5 mins over 5 tries
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsnolde committed Dec 18, 2023
1 parent f3b661a commit 0eee347
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/valhalla_build_elevation
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ def download(tile: Tile, output_dir, compression: TileCompression) -> bool:
LOGGER.info(f"Downloading tile {tile.name}")

download_status = DownloadStatus.FAILED
for i in range(15):
for i in range(5):
try:
LOGGER.debug(f"Downloading tile {tile.dir}/{tile.name} for the {i}th time.")

# tries up to 4.3 hours with exponentially increasing sleeps in between
# tries up to 24 mins with exponentially increasing sleeps in between, starting with 5 seconds
sleep((i**2) / 2 * 30)
with request.urlopen(url) as res, open(filepath, "wb") as f:

Expand Down

0 comments on commit 0eee347

Please sign in to comment.