From 5eb8bde5f7d545553bc62c29c1cb331088db925d Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Thu, 31 Oct 2024 18:08:10 +0530 Subject: [PATCH] Move finalization out of the transition lock --- app/models/step_run.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/step_run.rb b/app/models/step_run.rb index c7d1c76a5..cdb692934 100644 --- a/app/models/step_run.rb +++ b/app/models/step_run.rb @@ -156,9 +156,7 @@ class StepRun < ApplicationRecord transitions from: [:deployment_started, :deployment_restarted], to: :failed_with_action_required end - event(:finish) do - after { event_stamp!(reason: :finished, kind: :success, data: stamp_data) } - after { finalize_release } + event(:finish, after_commit: :finalize_release) do transitions from: [:deployment_started, :deployment_restarted], to: :success end @@ -515,6 +513,7 @@ def after_finish_ci end def finalize_release + event_stamp!(reason: :finished, kind: :success, data: stamp_data) Coordinators::FinishPlatformRun.call(release_platform_run) if release_platform_run.finalizable? end end