diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-01-25 21:14:56 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-01-25 21:14:56 +0300 |
commit | 637894de8868b05499a275e1685621473addef58 (patch) | |
tree | 017f01e30effce8f80cfae61be5296e318f55cdb /app | |
parent | 6cfe60df2275dace9804f4bc37b9746a9eadc6fd (diff) | |
parent | 31be74c74b72a1cd33e1630f9462ab5c43f2e319 (diff) |
Merge branch 'fix-ci-requests-concurrency' into 'master'
Fix CI requests concurrency
See merge request !8760
Diffstat (limited to 'app')
-rw-r--r-- | app/services/ci/register_build_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/ci/register_build_service.rb b/app/services/ci/register_build_service.rb index cd548b3c8d5..6f03bf2be13 100644 --- a/app/services/ci/register_build_service.rb +++ b/app/services/ci/register_build_service.rb @@ -6,6 +6,8 @@ module Ci attr_reader :runner + Result = Struct.new(:build, :valid?) + def initialize(runner) @runner = runner end @@ -29,10 +31,10 @@ module Ci build.run! end - build + Result.new(build, true) rescue StateMachines::InvalidTransition, ActiveRecord::StaleObjectError - nil + Result.new(build, false) end private |