613562f504
Co-authored-by: Kit Langton <kit.langton@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
12 lines
356 B
TypeScript
12 lines
356 B
TypeScript
import { Schedule } from "effect"
|
|
import { HttpClient } from "effect/unstable/http"
|
|
|
|
export const withTransientReadRetry = <E, R>(client: HttpClient.HttpClient.With<E, R>) =>
|
|
client.pipe(
|
|
HttpClient.retryTransient({
|
|
retryOn: "errors-and-responses",
|
|
times: 2,
|
|
schedule: Schedule.exponential(200).pipe(Schedule.jittered),
|
|
}),
|
|
)
|