summaryrefslogtreecommitdiff
path: root/app/workers/pipeline_hooks_worker.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/workers/pipeline_hooks_worker.rb
parent7c07c07d7a2b93ab81964b9cd28736652da1370a (diff)
downloadgitlab-ce-2461e10912b484c6942cd26f8fffd5c5557befa7.tar.gz
Execute pipeline hooks asynchronously
Diffstat (limited to 'app/workers/pipeline_hooks_worker.rb')
-rw-r--r--app/workers/pipeline_hooks_worker.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/workers/pipeline_hooks_worker.rb b/app/workers/pipeline_hooks_worker.rb
new file mode 100644
index 00000000000..ab5e9f6daad
--- /dev/null
+++ b/app/workers/pipeline_hooks_worker.rb
@@ -0,0 +1,9 @@
+class PipelineHooksWorker
+ include Sidekiq::Worker
+ sidekiq_options queue: :default
+
+ def perform(pipeline_id)
+ Ci::Pipeline.find_by(id: pipeline_id)
+ .try(:execute_hooks)
+ end
+end