Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-08-22 11:57:52 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-08-22 11:57:52 +0300
commit086f0351df9f013b4b0f3f80f7ab5d18be0d1733 (patch)
treef48f8f70e0e8842f16ef3ce5cd7577789c04641a /app
parent6509833cfa211804048ec4711572e3b44a5be21c (diff)
Do not fire synrchonous hooks when creating a job
Fire asynchronous hooks instead.
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 4692fb5644a..936e3c83dfd 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -46,7 +46,10 @@ module Ci
before_save :ensure_token
before_destroy { unscoped_project }
- after_create :execute_hooks
+ after_create do |build|
+ BuildHooksWorker.perform_async(build.id)
+ end
+
after_commit :update_project_statistics_after_save, on: [:create, :update]
after_commit :update_project_statistics, on: :destroy