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

Function retryAfterAtMost

packages/effect/src/http/HttpClient.ts:2659–2667  ·  view source on GitHub ↗
(
  max: Duration.Input
)

Source from the content-addressed store, hash-verified

2657 * @since 4.1.8
2658 */
2659export const retryAfterAtMost = (
2660 max: Duration.Input
2661): <Input>(metadata: Schedule.InputMetadata<Input>) => boolean => {
2662 const limit = Duration.fromInputUnsafe(max)
2663 return ({ input, now }) => {
2664 const delay = retryAfterDelay(now, retryAfterHeaderOf(input))
2665 return delay === undefined || Duration.isLessThanOrEqualTo(delay, limit)
2666 }
2667}
2668
2669const withRetryAfter = <ES, R1>(
2670 schedule: Schedule.Schedule<unknown, any, ES, R1>

Callers

nothing calls this directly

Calls 2

retryAfterHeaderOfFunction · 0.85
retryAfterDelayFunction · 0.70

Tested by

no test coverage detected