Retry backoff
cmd_retry_backoff¶
Retry a command with exponential backoff. Waits 1s, 2s, 4s, 8s … up to SHELLAC_RETRY_MAX_WAIT seconds between attempts. Default cap is 60 seconds.
Example¶
cmd_retry_backoff 5 curl -sf https://example.com
Arguments¶
- $1 (int): Maximum number of attempts (default: 5)
- ... (Command): and its arguments
Exit codes¶
- 0: Command succeeded within attempts; 1 All attempts failed; 2 Missing command
cmd_retry_constant¶
Retry a command with a constant wait interval until it succeeds.
Example¶
cmd_retry_constant 10 3 ping -c1 192.168.1.1
Arguments¶
- $1 (int): Maximum number of attempts (default: 5)
- $2 (int): Wait seconds between attempts (default: 5)
- ... (Command): and its arguments
Exit codes¶
- 0: Command succeeded; 1 All attempts failed; 2 Missing command
cmd_retry_until¶
Retry a command until it succeeds or a timeout is reached. Polls every $2 seconds (default: 5).
Example¶
cmd_retry_until 120 10 curl -sf http://localhost:8080/health
Arguments¶
- $1 (int): Timeout in seconds
- $2 (int): Poll interval in seconds (default: 5)
- ... (Command): and its arguments
Exit codes¶
- 0: Command succeeded; 1 Timeout reached; 2 Missing command