diff --git a/backend/schema/metadataretry.go b/backend/schema/metadataretry.go index 518a6ad166..d87acb4e55 100644 --- a/backend/schema/metadataretry.go +++ b/backend/schema/metadataretry.go @@ -15,9 +15,10 @@ import ( ) const ( - DefaultRetryCount = 100 + DefaultRetryCount = 10 MinBackoffLimitStr = "1s" MinBackoffLimit = 1 * time.Second + DefaultMaxBackoff = 1 * time.Hour MaxBackoffLimitStr = "1d" MaxBackoffLimit = 24 * time.Hour ) @@ -118,7 +119,7 @@ func (m *MetadataRetry) RetryParams() (RetryParams, error) { // max backoff if m.MaxBackoff == "" { - params.MaxBackoff = MaxBackoffLimit + params.MaxBackoff = max(minBackoff, DefaultMaxBackoff) } else { maxBackoff, err := parseRetryDuration(m.MaxBackoff) if err != nil { diff --git a/docs/content/docs/reference/retries.md b/docs/content/docs/reference/retries.md index b1d5d07d99..332e8b649b 100644 --- a/docs/content/docs/reference/retries.md +++ b/docs/content/docs/reference/retries.md @@ -16,11 +16,9 @@ top = false Any verb called asynchronously (specifically, PubSub subscribers and FSM states), may optionally specify a basic exponential backoff retry policy via a Go comment directive. The directive has the following syntax: ```go -//ftl:retry [] [] [catch ] +//ftl:retry [] [] [catch ] ``` -`attempts` and `max-backoff` default to unlimited if not specified. - For example, the following function will retry up to 10 times, with a delay of 5s, 10s, 20s, 40s, 60s, 60s, etc. ```go diff --git a/lsp/markdown/completion/retry.md b/lsp/markdown/completion/retry.md index 365c5f09e4..10b78cc090 100644 --- a/lsp/markdown/completion/retry.md +++ b/lsp/markdown/completion/retry.md @@ -3,7 +3,7 @@ Directive for retrying an async operation. Any verb called asynchronously (specifically, PubSub subscribers and FSM states), may optionally specify a basic exponential backoff retry policy. ```go -//ftl:retry [] [] +//ftl:retry [] [] [catch ] ``` See https://tbd54566975.github.io/ftl/docs/reference/retries/