diff options
Diffstat (limited to 'app/workers/build_success_worker.rb')
-rw-r--r-- | app/workers/build_success_worker.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/build_success_worker.rb b/app/workers/build_success_worker.rb index 114bced0b22..247105d2a1a 100644 --- a/app/workers/build_success_worker.rb +++ b/app/workers/build_success_worker.rb @@ -13,13 +13,13 @@ class BuildSuccessWorker # rubocop:disable Scalability/IdempotentWorker def perform(build_id) Ci::Build.find_by_id(build_id).try do |build| - stop_environment(build) if build.stops_environment? + stop_environment(build) if build.stops_environment? && build.stop_action_successful? end end private def stop_environment(build) - build.persisted_environment.fire_state_event(:stop) + build.persisted_environment.fire_state_event(:stop_complete) end end |