Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,18 @@ def upload_to_s3(file, key)
#
# @param version [String] Version to be downloaded
# @param [String] Build file downloaded.
# @raise [RuntimeError] If the file fails to download correctly after 3
# attempts.
# @raise [RuntimeError] If the file fails to download correctly within 60 minutes.
def download_from_github(version)
file_pattern = "*#{version}*.tar.gz"
attempts = 0

Retriable.retriable on: RuntimeError do
retry_opts = {
tries: 360, # up to 360 x 10s = 60 minutes
max_elapsed_time: 60 * 60, # 60 minutes
base_interval: 10,
multiplier: 1 # constant interval, no exponential backoff
}

Retriable.retriable(on: RuntimeError, **retry_opts) do
# Make sure the directory is empty before downloading the release.
FileUtils.rm(Dir.glob('*'))

Expand Down