Files
zgene 6bed393c12
Backend Tests / backend-unit-test (push) Has been cancelled
Backend Tests / benchmark-test (push) Has been cancelled
CI@main / Node.js v22 (ubuntu-latest) (push) Has been cancelled
Thrift Syntax Validation / validate-thrift (push) Has been cancelled
License Check / License Check (push) Has been cancelled
first commit
2026-05-14 13:29:56 +08:00

22 lines
504 B
Bash

retry() {
local retries=$1 # number of retries
local wait_time=$2 # waiting time
shift 2
local count=0
cd $(pwd)
until "$@"; do
exit_code=$?
count=$((count + 1))
if [ $count -lt $retries ]; then
echo "Attempt $count/$retries failed with exit code $exit_code. Retrying in $wait_time seconds..."
sleep $wait_time
else
echo "Attempt $count/$retries failed with exit code $exit_code. No more retries left."
return $exit_code
fi
done
return 0
}