diff --git a/packages/effect-fc/src/Result.ts b/packages/effect-fc/src/Result.ts index 7818d28..edb38a9 100644 --- a/packages/effect-fc/src/Result.ts +++ b/packages/effect-fc/src/Result.ts @@ -239,7 +239,10 @@ export const forkEffectDequeue = ( Effect.tap(([ref, queue]) => Effect.forkScoped(State().pipe( Effect.andThen(state => state.set(running(options?.initialProgress)).pipe( Effect.andThen(effect), - Effect.onExit(exit => Effect.andThen(state.set(fromExit(exit)), Queue.shutdown(queue))), + Effect.onExit(exit => Effect.andThen( + state.set(fromExit(exit)), + Effect.forkScoped(Queue.shutdown(queue)), + )), )), Effect.provide(Layer.empty.pipe( Layer.provideMerge(makeProgressLayer()),