diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-21 15:12:11 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-10-26 11:37:23 +0200 |
commit | 47b2add4f62d64d1a46109910c86805728e548c4 (patch) | |
tree | 58bee6cd9dbd1f4b7be7761578b9a18486998b36 /app | |
parent | 5d7ee7a1b6c818dd0ccba6a393875072dabd7eba (diff) | |
download | gitlab-ce-47b2add4f62d64d1a46109910c86805728e548c4.tar.gz |
Add tests for optimistic locking
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/pipeline.rb | 2 | ||||
-rw-r--r-- | app/services/ci/register_build_service.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 27178e2a6c1..d3432632899 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -260,7 +260,7 @@ module Ci end def update_status - Gitlab::OptimisticLocking.retry_lock(build) do + Gitlab::OptimisticLocking.retry_lock(self) do case latest_builds_status when 'pending' then enqueue when 'running' then run diff --git a/app/services/ci/register_build_service.rb b/app/services/ci/register_build_service.rb index 8d3bc8e2dee..74b5ebf372b 100644 --- a/app/services/ci/register_build_service.rb +++ b/app/services/ci/register_build_service.rb @@ -35,7 +35,7 @@ module Ci build - rescue StateMachines::InvalidTransition, StaleObjectError + rescue StateMachines::InvalidTransition, ActiveRecord::StaleObjectError nil end |