From 95d0bf70bdfd0c219b7ad071c30b1ebb3977accd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Thu, 15 Jan 2026 22:24:36 +0100 Subject: [PATCH] Fix --- packages/effect-fc/src/Query.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/effect-fc/src/Query.ts b/packages/effect-fc/src/Query.ts index 32421f3..15d3efd 100644 --- a/packages/effect-fc/src/Query.ts +++ b/packages/effect-fc/src/Query.ts @@ -59,18 +59,17 @@ extends Pipeable.Class() implements Query { } get run(): Effect.Effect { - return Effect.provide( - Stream.runForEach(this.key, key => this.interrupt.pipe( - Effect.andThen(SubscriptionRef.set(this.latestKey, Option.some(key))), - Effect.andThen(this.latestFinalResult), - Effect.andThen(previous => this.startCached(key, Option.isSome(previous) - ? Result.willFetch(previous.value) as Result.Final - : Result.initial() - )), - Effect.andThen(sub => Effect.forkScoped(this.watch(key, sub))), - this.runSemaphore.withPermits(1), + return Stream.runForEach(this.key, key => this.interrupt.pipe( + Effect.andThen(SubscriptionRef.set(this.latestKey, Option.some(key))), + Effect.andThen(this.latestFinalResult), + Effect.andThen(previous => this.startCached(key, Option.isSome(previous) + ? Result.willFetch(previous.value) as Result.Final + : Result.initial() )), - this.context, + Effect.andThen(sub => Effect.forkScoped(this.watch(key, sub))), + )).pipe( + this.runSemaphore.withPermits(1), + Effect.provide(this.context), ) }