From 943a6e2b71f02570bb5717234ce6a71a8daa715e Mon Sep 17 00:00:00 2001 From: Tim Linschoten Date: Sun, 24 Nov 2024 19:22:43 +0100 Subject: [PATCH] Stopped using effect.bracket during execution since this sometimes stops mid execution. --- .../runtime/model/recipeinstance/TransitionExecution.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/baker-interface/src/main/scala/com/ing/baker/runtime/model/recipeinstance/TransitionExecution.scala b/core/baker-interface/src/main/scala/com/ing/baker/runtime/model/recipeinstance/TransitionExecution.scala index 1650fc14f..36283f812 100644 --- a/core/baker-interface/src/main/scala/com/ing/baker/runtime/model/recipeinstance/TransitionExecution.scala +++ b/core/baker-interface/src/main/scala/com/ing/baker/runtime/model/recipeinstance/TransitionExecution.scala @@ -181,8 +181,11 @@ private[recipeinstance] case class TransitionExecution( interactionStarted <- effect.delay(InteractionStarted(startTime, recipe.name, recipe.recipeId, recipeInstanceId, interactionTransition.interactionName)) _ <- effect.delay(components.logging.interactionStarted(interactionStarted)) _ <- components.eventStream.publish(interactionStarted) - - interactionOutput <- effect.bracket(setupMdc)(_ => execute)(_ => cleanMdc) + interactionOutput <- + setupMdc.map(_ => execute).flatMap(x => { + cleanMdc + x + }) _ <- validateInteractionOutput(interactionTransition, interactionOutput) transformedOutput: Option[EventInstance] = interactionOutput.map(_.transformWith(interactionTransition))