Documentation
¶
Overview ¶
Package startup retries the check a module makes of an external service while the service starts: a database or a storage that comes up a moment after the instance, as happens in a rolling deploy, does not stop the start.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Retry ¶
func Retry(ctx context.Context, log *slog.Logger, what string, budget time.Duration, try func(context.Context) error, permanent func(error) bool) error
Retry runs try until it succeeds, fails with an error permanent reports, the parent context ends, or budget runs out. The first attempt always runs; no new attempt starts once budget has passed since the first one, so a zero budget is a single attempt. Each attempt bounds itself; Retry does not cut a running attempt short. Failed attempts that are retried are logged at warn level.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.