diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-12-13 13:25:14 +0100 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-01-02 19:02:46 +0100 |
commit | 7ebd36e302e3e6c118f47d18d6c72a83418097d2 (patch) | |
tree | 82cd0c0a8229c40afd86824c1acc6459057d7945 /app/models/ci/build.rb | |
parent | 1a83d9387f6db91f2adae5c3d66c6e21077967bc (diff) | |
download | gitlab-ce-7ebd36e302e3e6c118f47d18d6c72a83418097d2.tar.gz |
Prefer to use after_transitionuse-after-transition
Before_transition does not play nice when used with
OptimisticLocking and this can result in triggering
multiple events
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55306
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r-- | app/models/ci/build.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 16a72c680fa..5ac521b049a 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -220,6 +220,10 @@ module Ci next unless build.project build.deployment&.drop + end + + after_transition any => [:failed] do |build| + next unless build.project if build.retry_failure? begin |