Skip to content

Commit

Permalink
fix(common): Add retries to curl for downloads.keyman.com query
Browse files Browse the repository at this point in the history
  • Loading branch information
darcywong00 committed Apr 29, 2024
1 parent aab6c1c commit b1409dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/build/build-download-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function downloadKeyboardPackage() {
local RETRY_DELAY=5 # Make curl sleep this amount of time before each retry when a transfer has failed

echo "Downloading ${ID}.kmp from downloads.keyman.com up to ${RETRY} attempts"
local URL_DOWNLOAD_FILE=`curl --silent "$URL_API_KEYBOARD_VERSION/${ID}" | "$JQ" -r .kmp`
local URL_DOWNLOAD_FILE=`curl --retry "$RETRY" --retry-delay "$RETRY_DELAY" --silent "$URL_API_KEYBOARD_VERSION/${ID}" | "$JQ" -r .kmp`
curl --fail --retry "$RETRY" --retry-delay "$RETRY_DELAY" --silent "$URL_DOWNLOAD_FILE" --output "$KEYBOARDS_TARGET" || {
builder_die "Downloading $KEYBOARDS_TARGET failed with error $?"
}
Expand All @@ -55,7 +55,7 @@ function downloadModelPackage() {
local RETRY_DELAY=5 # Make curl sleep this amount of time before each retry when a transfer has failed

echo "Downloading ${ID}.model.kmp from downloads.keyman.com up to ${RETRY} attempts"
local URL_DOWNLOAD_FILE=`curl --silent "$URL_API_MODEL_VERSION/${ID}" | "$JQ" -r .kmp`
local URL_DOWNLOAD_FILE=`curl --retry "$RETRY" --retry-delay "$RETRY_DELAY" --silent "$URL_API_MODEL_VERSION/${ID}" | "$JQ" -r .kmp`
curl --fail --retry "$RETRY" --retry-delay "$RETRY_DELAY" --silent "$URL_DOWNLOAD_FILE" --output "$MODELS_TARGET" || {
builder_die "Downloading $MODELS_TARGET failed with error $?"
}
Expand Down

0 comments on commit b1409dd

Please sign in to comment.