MCPcopy Create free account
hub / github.com/bytebase/bytebase / Retry

Function Retry

backend/common/retry.go:18–26  ·  view source on GitHub ↗

Retry uses exponential backoff with timeout.

(ctx context.Context, fn func() error)

Source from the content-addressed store, hash-verified

16
17// Retry uses exponential backoff with timeout.
18func Retry(ctx context.Context, fn func() error) error {
19 b := backoff.NewExponentialBackOff()
20 b.InitialInterval = initialInterval
21
22 _, err := backoff.Retry(ctx, func() (struct{}, error) {
23 return struct{}{}, fn()
24 }, backoff.WithBackOff(b), backoff.WithMaxElapsedTime(timeout), backoff.WithMaxTries(3))
25 return err
26}

Callers 7

postDirectMessageFunction · 0.92
sendDirectMessageFunction · 0.92
sendDirectMessageMethod · 0.92
postDirectMessageFunction · 0.92
postDirectMessageFunction · 0.92
postDirectMessageFunction · 0.92
postWebhookListMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected