diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-12 18:12:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-12 18:12:08 +0300 |
commit | 13f15365a344255ded8b3bf6586716b0963be440 (patch) | |
tree | 48b5290c7f84fab4e79577b1d463798feaa4257f /app/services/deployments | |
parent | 57a3a42c88f6e7dbcfd388a5c83302f0bb666023 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/deployments')
-rw-r--r-- | app/services/deployments/older_deployments_drop_service.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/services/deployments/older_deployments_drop_service.rb b/app/services/deployments/older_deployments_drop_service.rb index 100d1267848..504b55b99ac 100644 --- a/app/services/deployments/older_deployments_drop_service.rb +++ b/app/services/deployments/older_deployments_drop_service.rb @@ -11,23 +11,23 @@ module Deployments def execute return unless @deployment&.running? - older_deployments.find_each do |older_deployment| - Gitlab::OptimisticLocking.retry_lock(older_deployment.deployable, name: 'older_deployments_drop') do |deployable| - deployable.drop(:forward_deployment_failure) + older_deployments_builds.each do |build| + Gitlab::OptimisticLocking.retry_lock(build, name: 'older_deployments_drop') do |build| + build.drop(:forward_deployment_failure) end rescue StandardError => e - Gitlab::ErrorTracking.track_exception(e, subject_id: @deployment.id, deployment_id: older_deployment.id) + Gitlab::ErrorTracking.track_exception(e, subject_id: @deployment.id, build_id: build.id) end end private - def older_deployments + def older_deployments_builds @deployment .environment .active_deployments .older_than(@deployment) - .with_deployable + .builds end end end |