summaryrefslogtreecommitdiff
path: root/app/models/ci/pipeline.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-12 13:44:33 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-12 20:20:01 +0200
commit2461e10912b484c6942cd26f8fffd5c5557befa7 (patch)
tree0f4c604918ed24a2421bd427fbfcb74328c6fbaa /app/models/ci/pipeline.rb
parent7c07c07d7a2b93ab81964b9cd28736652da1370a (diff)
downloadgitlab-ce-2461e10912b484c6942cd26f8fffd5c5557befa7.tar.gz
Execute pipeline hooks asynchronously
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r--app/models/ci/pipeline.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 2cf9892edc5..13a58a7a308 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -3,6 +3,7 @@ module Ci
extend Ci::Model
include HasStatus
include Importable
+ include AfterCommitQueue
self.table_name = 'ci_commits'
@@ -71,7 +72,11 @@ module Ci
end
after_transition do |pipeline, transition|
- pipeline.execute_hooks unless transition.loopback?
+ next if transition.loopback?
+
+ pipeline.run_after_commit do
+ PipelineHooksWorker.perform_async(id)
+ end
end
end