Use before_transition
This commit is contained in:
parent
1bed2c87e9
commit
cdfa17c429
1 changed files with 4 additions and 4 deletions
|
@ -70,6 +70,10 @@ module Ci
|
|||
pipeline.update_duration
|
||||
end
|
||||
|
||||
before_transition :canceled => any - [:canceled] do |pipeline|
|
||||
pipeline.auto_canceled_by = nil
|
||||
end
|
||||
|
||||
after_transition [:created, :pending] => :running do |pipeline|
|
||||
pipeline.run_after_commit { PipelineMetricsWorker.perform_async(id) }
|
||||
end
|
||||
|
@ -95,10 +99,6 @@ module Ci
|
|||
PipelineNotificationWorker.perform_async(pipeline.id)
|
||||
end
|
||||
end
|
||||
|
||||
after_transition :canceled => any - [:canceled] do |pipeline|
|
||||
pipeline.auto_canceled_by = nil
|
||||
end
|
||||
end
|
||||
|
||||
# ref can't be HEAD or SHA, can only be branch/tag name
|
||||
|
|
Loading…
Reference in a new issue