[HYBRID-v3] architect handoff + retry policy 5x/120s
This commit is contained in:
1 parent
f1d88de14e
commit
b8efe51b1b
2 files changed
+135
No files matched your search
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# retry.sh — 5 attempts, 120s between, for transport failures only.
|
||||
# usage: retry.sh <cmd> [args...]
|
||||
set -u
|
||||
n=0
|
||||
max=5
|
||||
while [ "$n" -lt "$max" ]; do
|
||||
n=$((n+1))
|
||||
echo "[retry] attempt $n/$max: $*" >&2
|
||||
if "$@"; then
|
||||
echo "[retry] success on attempt $n" >&2
|
||||
exit 0
|
||||
fi
|
||||
if [ "$n" -lt "$max" ]; then
|
||||
sleep 120
|
||||
fi
|
||||
done
|
||||
echo "[retry] failed after $max attempts" >&2
|
||||
exit 1
|
||||
Reference in new issue
Block a user