Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added retry support based on Sebulec implementation of my idea #61

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
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
18 changes: 17 additions & 1 deletion step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,23 @@ fi
echo_details "$submit_cmd"
echo

eval "${submit_cmd}"
number_of_allowed_retries=3 # Set the number of allowed retries before the loop
retry_count=0 # Initialize retry_count before the loop starts

while true; do
if eval "${submit_cmd}"; then
echo_details "Submission successful."
break
else
((retry_count++))
echo_details "Submission failed, retry #${retry_count}..."
if [ "${retry_count}" -eq "${number_of_allowed_retries}" ]; then # Ensure quotes around variables for safety
echo_details "Third attempt failed. Exiting."
exit 1
fi
sleep 3
fi
done

if [ $? -eq 0 ] ; then
echo_done "Success"
Expand Down