MCPcopy Create free account
hub / github.com/Effect-TS/effect / retry

Function retry

packages/effect/src/http/HttpClient.ts:1429–1433  ·  view source on GitHub ↗
(retryAfter: Duration.Duration | undefined)

Source from the content-addressed store, hash-verified

1427 const current = getState(key)
1428 const canRetry = options.times === undefined || retries < options.times
1429 function retry(retryAfter: Duration.Duration | undefined) {
1430 return retryAfter
1431 ? Effect.flatMap(Effect.sleep(retryAfter), () => loop(effect, request, retries + 1))
1432 : loop(effect, request, retries + 1)
1433 }
1434 const inspectResponse = (
1435 response: HttpClientResponse.HttpClientResponse,
1436 adaptive: RateLimiter.AdaptiveConsumeResult | undefined

Callers 3

onSuccessFunction · 0.70
onFailureFunction · 0.70
openNativeFunction · 0.50

Calls 2

loopFunction · 0.70
sleepMethod · 0.65

Tested by

no test coverage detected