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
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-11-29 18:30:17 +0300
committerDouwe Maan <douwe@selenight.nl>2017-12-05 13:59:39 +0300
commit1e6ca3c41ead23c5e433460c8c807ea73d9ec0ef (patch)
treeed6a5da0def848adc1a15f80e69d9c55651895a4 /app/services/system_hooks_service.rb
parenta5c3f1c8ff7da20183b172b2b0693a6010c9e86d (diff)
Consistently schedule Sidekiq jobs
Diffstat (limited to 'app/services/system_hooks_service.rb')
-rw-r--r--app/services/system_hooks_service.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb
index 911cc919bb8..690918b4a00 100644
--- a/app/services/system_hooks_service.rb
+++ b/app/services/system_hooks_service.rb
@@ -1,6 +1,10 @@
class SystemHooksService
def execute_hooks_for(model, event)
- execute_hooks(build_event_data(model, event))
+ data = build_event_data(model, event)
+
+ model.run_after_commit_or_now do
+ SystemHooksService.new.execute_hooks(data)
+ end
end
def execute_hooks(data, hooks_scope = :all)