(input: LoadInput)
| 124 | } |
| 125 | |
| 126 | const reload = (input: LoadInput): Effect.Effect<InstanceContext> => { |
| 127 | const directory = FSUtil.resolve(input.directory) |
| 128 | return Effect.uninterruptibleMask((restore) => |
| 129 | Effect.gen(function* () { |
| 130 | const previous = cache.get(directory) |
| 131 | const entry: Entry = { deferred: Deferred.makeUnsafe<InstanceContext>() } |
| 132 | cache.set(directory, entry) |
| 133 | yield* Effect.gen(function* () { |
| 134 | yield* Effect.logInfo("reloading instance", { directory: directory }) |
| 135 | if (previous) { |
| 136 | yield* Deferred.await(previous.deferred).pipe(Effect.ignore) |
| 137 | yield* Effect.promise(() => runDisposers(directory)) |
| 138 | yield* emitDisposed({ directory, project: input.project?.id }) |
| 139 | } |
| 140 | yield* completeLoad(directory, input, entry) |
| 141 | }).pipe(Effect.forkIn(scope, { startImmediately: true })) |
| 142 | return yield* restore(Deferred.await(entry.deferred)) |
| 143 | }), |
| 144 | ).pipe(Effect.withSpan("InstanceStore.reload")) |
| 145 | } |
| 146 | |
| 147 | const dispose = Effect.fn("InstanceStore.dispose")(function* (ctx: InstanceContext) { |
| 148 | const entry = cache.get(ctx.directory) |
nothing calls this directly
no test coverage detected