Skip to content

Commit 4ac656c

Browse files
committed
Run shutdown Ref.sets sequentially instead of via collectAllParDiscard
1 parent 767dd3e commit 4ac656c

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

core/src/main/scala/zio/openfeature/FeatureFlagsLive.scala

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -830,15 +830,13 @@ final private[openfeature] class FeatureFlagsLive(
830830
// Shutdown API (spec 1.6.1, 1.6.2)
831831

832832
override def shutdown: UIO[Unit] =
833-
ZIO.collectAllParDiscard(
834-
List(
835-
state.statusRef.set(ProviderStatus.NotReady),
836-
state.hooksRef.set(List.empty),
837-
state.globalContextRef.set(EvaluationContext.empty),
838-
state.clientContextRef.set(EvaluationContext.empty),
839-
state.trackRecorder.set(List.empty)
840-
)
841-
) *> state.eventHub.shutdown *> ZIO.attemptBlocking(api.shutdown()).ignore
833+
state.statusRef.set(ProviderStatus.NotReady) *>
834+
state.hooksRef.set(List.empty) *>
835+
state.globalContextRef.set(EvaluationContext.empty) *>
836+
state.clientContextRef.set(EvaluationContext.empty) *>
837+
state.trackRecorder.set(List.empty) *>
838+
state.eventHub.shutdown *>
839+
ZIO.attemptBlocking(api.shutdown()).ignore
842840

843841
// Tracking API
844842

0 commit comments

Comments
 (0)