fix(core): defer cyclic layer dependencies
This commit is contained in:
parent
22c23cb44c
commit
c4830c147d
4 changed files with 16 additions and 3 deletions
|
|
@ -74,7 +74,7 @@ type MakeInput<
|
|||
T extends Tag | undefined = undefined,
|
||||
> = NodeIdentity & {
|
||||
readonly layer: Implementation
|
||||
readonly deps: Items & CheckDependencies<Implementation, NoInfer<Items>>
|
||||
readonly deps: (Items | (() => Items)) & CheckDependencies<Implementation, NoInfer<Items>>
|
||||
readonly tag?: T
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +90,9 @@ export function make<
|
|||
name: input.service !== undefined ? input.service.key : input.name,
|
||||
service: input.service,
|
||||
implementation: input.layer,
|
||||
dependencies: input.deps,
|
||||
get dependencies() {
|
||||
return typeof input.deps === "function" ? input.deps() : input.deps
|
||||
},
|
||||
tag: input.tag,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,8 @@ const SHELL_MAX_CAPTURE_BYTES = 1024 * 1024
|
|||
export const node = makeGlobalNode({
|
||||
service: Service,
|
||||
layer: layer.pipe(Layer.orDie),
|
||||
deps: [
|
||||
// Defer the execution node across the Session/runner module cycle until the graph is compiled.
|
||||
deps: () => [
|
||||
Job.node,
|
||||
Database.node,
|
||||
EventV2.node,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue