Skip to content

Commit 4f40f6c

Browse files
committed
fix(browser): deduplicate health probe options
1 parent 78ade66 commit 4f40f6c

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

packages/app/src/docker-git/controller-health.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,16 @@ export const findReachableApiBaseUrlMatchingRevision = (
147147
expectedRevision: string
148148
): Effect.Effect<string, ControllerBootstrapError> => findReachableApiBaseUrl(candidateUrls, expectedRevision)
149149

150-
export const findReachableDirectHealthProbeWithHttpClient = (options: {
150+
type DirectHealthProbeOptions = {
151151
readonly explicitApiBaseUrl: string | undefined
152152
readonly defaultLocalApiBaseUrl: string | undefined
153153
readonly cachedApiBaseUrl: string | undefined
154154
readonly expectedRevision?: string | undefined
155-
}): Effect.Effect<HealthProbeResult | null, never, HttpClient.HttpClient> =>
155+
}
156+
157+
export const findReachableDirectHealthProbeWithHttpClient = (
158+
options: DirectHealthProbeOptions
159+
): Effect.Effect<HealthProbeResult | null, never, HttpClient.HttpClient> =>
156160
findReachableHealthProbeOrNull(
157161
buildApiBaseUrlCandidates({
158162
explicitApiBaseUrl: options.explicitApiBaseUrl,
@@ -166,10 +170,7 @@ export const findReachableDirectHealthProbeWithHttpClient = (options: {
166170
options.expectedRevision
167171
)
168172

169-
export const findReachableDirectHealthProbe = (options: {
170-
readonly explicitApiBaseUrl: string | undefined
171-
readonly defaultLocalApiBaseUrl: string | undefined
172-
readonly cachedApiBaseUrl: string | undefined
173-
readonly expectedRevision?: string | undefined
174-
}): Effect.Effect<HealthProbeResult | null> =>
173+
export const findReachableDirectHealthProbe = (
174+
options: DirectHealthProbeOptions
175+
): Effect.Effect<HealthProbeResult | null> =>
175176
findReachableDirectHealthProbeWithHttpClient(options).pipe(Effect.provide(FetchHttpClient.layer))

0 commit comments

Comments
 (0)