Skip to content

Commit

Permalink
fix undici
Browse files Browse the repository at this point in the history
  • Loading branch information
leonitousconforti committed Oct 22, 2024
1 parent 09c8bcd commit 735dd6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/engines/Dind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export const makeDindLayerFromPlatformConstructor =

// Building a layer here instead of providing it to the final effect
// prevents conflicting services with the same tag in the final layer
const hostDocker = platformLayerConstructorCasted(options.connectionOptionsToHost);
const hostDocker = yield* Layer.build(platformLayerConstructorCasted(options.connectionOptionsToHost));
yield* DockerEngine.pingHead().pipe(Effect.provide(hostDocker));

// Build the docker image for the dind container
Expand All @@ -296,7 +296,7 @@ export const makeDindLayerFromPlatformConstructor =
buildArgs: { DIND_BASE_IMAGE: options.dindBaseImage },
tag: `the-moby-effect-${options.exposeDindContainerBy}-${dindTag}:latest`,
context: Convey.packBuildContextIntoTarballStream(HashMap.make(["Dockerfile", dindBlob] as const)),
}).pipe(Stream.provideSomeLayer(hostDocker));
}).pipe(Stream.provideContext(hostDocker));

// Wait for the image to be built
yield* Convey.waitForProgressToComplete(buildStream);
Expand Down
3 changes: 1 addition & 2 deletions src/platforms/Undici.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,12 @@ export const getUndiciDispatcher = (
export const makeUndiciHttpClientLayer = (
connectionOptions: MobyConnectionOptions
): Layer.Layer<HttpClient.HttpClient, never, never> => {
const undiciDispatcher = getUndiciDispatcher(connectionOptions);
const undiciLayer = Function.pipe(
Effect.promise(() => import("@effect/platform-node/NodeHttpClient")),
Effect.map((nodeHttpClientLazy) =>
Layer.provide(
nodeHttpClientLazy.layerUndiciWithoutDispatcher,
Layer.scoped(nodeHttpClientLazy.Dispatcher, undiciDispatcher)
Layer.scoped(nodeHttpClientLazy.Dispatcher, getUndiciDispatcher(connectionOptions))
)
),
Layer.unwrapEffect
Expand Down

0 comments on commit 735dd6b

Please sign in to comment.