Files
anomalyco_opencode/packages/opencode/src/util/effect-http-client.ts
T
2026-03-10 12:53:47 -04:00

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),
}),
)