You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Ubuntu] Added HTTP status code check to download_with_retries (actions#3721)
* Disable exit on error temporary to implement retry logic based on exit code
* Check HTTP response code and retry if it's not 200
* Make variables local to not interfere with other scripts
Co-authored-by: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com>
# Temporary disable exit on error to retry on non-zero exit code
28
+
set +e
29
+
http_code=$(eval $COMMAND)
30
+
exit_code=$?
31
+
if [ $http_code-eq 200 ] && [ $exit_code-eq 0 ];then
30
32
echo"Download completed"
31
33
return 0
34
+
else
35
+
echo"Error — Either HTTP response code for '$URL' is wrong - '$http_code' or exit code is not 0 - '$exit_code'. Waiting $interval seconds before the next attempt, $retries attempts left"
0 commit comments