MCPcopy Create free account
hub / github.com/effect-app/libs / createContainer

Function createContainer

packages/infra/src/ClusterCosmos.ts:347–360  ·  view source on GitHub ↗
(prefix: string)

Source from the content-addressed store, hash-verified

345const machineIdCounterDocId = cosmosId("machine-id-counter")
346
347const createContainer = (prefix: string) =>
348 Effect.fnUntraced(function*() {
349 const { db } = yield* CosmosClient
350 const containerId = `${prefix}cluster`
351 yield* Effect
352 .tryPromise(() =>
353 db.containers.create({
354 id: containerId,
355 partitionKey: { paths: ["/_partitionKey"], version: 2 }
356 })
357 )
358 .pipe(Effect.catchIf(isConflict, () => Effect.void))
359 return db.container(containerId)
360 })
361
362export const makeMessageStorage = Effect.fnUntraced(function*(options?: {
363 readonly prefix?: string | undefined

Callers 1

ClusterCosmos.tsFile · 0.85

Calls 1

pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…