diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-05 12:34:05 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-05 12:34:05 +0300 |
commit | 3cc5e48668caf97588241001866fd42666b2f8f0 (patch) | |
tree | 03cf2c22213686fad5829b896f515ebe9beeef3c /app/models/commit_status.rb | |
parent | 3b39cf4e0c5d0ca680a40bb7232fee4f7fdfb02e (diff) | |
parent | 103b5bf60ba952e661b3e22d866cc64eed7358ee (diff) |
Merge branch 'sidekiq-transaction' into 'master'
Forbid Sidekiq scheduling in transactions
Closes #27233
See merge request !9376
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index fe63728ea23..ce507f7774b 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -18,7 +18,7 @@ class CommitStatus < ActiveRecord::Base validates :name, presence: true alias_attribute :author, :user - + scope :failed_but_allowed, -> do where(allow_failure: true, status: [:failed, :canceled]) end @@ -83,14 +83,15 @@ class CommitStatus < ActiveRecord::Base next if transition.loopback? commit_status.run_after_commit do - pipeline.try do |pipeline| + if pipeline if complete? || manual? PipelineProcessWorker.perform_async(pipeline.id) else PipelineUpdateWorker.perform_async(pipeline.id) end - ExpireJobCacheWorker.perform_async(commit_status.id) end + + ExpireJobCacheWorker.perform_async(commit_status.id) end end |