Commit 865de49b authored by Grzegorz Bizon's avatar Grzegorz Bizon

Update related stage status when job status is changed

parent 8657d5dd
...@@ -17,6 +17,8 @@ module Ci ...@@ -17,6 +17,8 @@ module Ci
validates :pipeline, presence: true, unless: :importing? validates :pipeline, presence: true, unless: :importing?
validates :name, presence: true, unless: :importing? validates :name, presence: true, unless: :importing?
## TODO, should we extract these events to `Ci::Eventable`?
#
state_machine :status, initial: :created do state_machine :status, initial: :created do
event :enqueue do event :enqueue do
transition created: :pending transition created: :pending
......
...@@ -91,6 +91,7 @@ class CommitStatus < ActiveRecord::Base ...@@ -91,6 +91,7 @@ class CommitStatus < ActiveRecord::Base
end end
end end
StageUpdateWorker.perform_async(commit_status.stage_id)
ExpireJobCacheWorker.perform_async(commit_status.id) ExpireJobCacheWorker.perform_async(commit_status.id)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment