Skip to content

Commit

Permalink
try adding a delay to http calls
Browse files Browse the repository at this point in the history
  • Loading branch information
lthiery committed Jan 31, 2024
1 parent 98b550d commit 6f579be
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/scripts/idl-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,21 @@ function get_cargo_version() {
echo "$CARGO_VERSION"
}

function random_delay() {
# Generate a random integer between 10 and 3276
random_int=$((RANDOM % (3276 - 10 + 1) + 10))
# Convert the random integer to a floating-point number between 0.1 and 1
random_float=$(echo "scale=1; $random_int / 3276" | bc)
sleep $random_float
}

P=$1
# replace underscores with hyphens
PREFIX=program-${P//_/-}
PAGE=1
while true; do
TAG=$(get_tags "$PREFIX" "$PAGE")

random_delay
#if tag exited with non-zero, exit
status_code=$?
if [ $status_code -ne 0 ]; then
Expand Down

0 comments on commit 6f579be

Please sign in to comment.