diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-11-29 16:30:17 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-12-05 11:59:39 +0100 |
commit | 1e6ca3c41ead23c5e433460c8c807ea73d9ec0ef (patch) | |
tree | ed6a5da0def848adc1a15f80e69d9c55651895a4 /app/services | |
parent | a5c3f1c8ff7da20183b172b2b0693a6010c9e86d (diff) | |
download | gitlab-ce-dm-application-worker.tar.gz |
Consistently schedule Sidekiq jobsdm-application-worker
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/system_hooks_service.rb | 6 | ||||
-rw-r--r-- | app/services/web_hook_service.rb | 2 |
2 files changed, 6 insertions, 2 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) diff --git a/app/services/web_hook_service.rb b/app/services/web_hook_service.rb index cd99e0b90f9..6ebc7c89500 100644 --- a/app/services/web_hook_service.rb +++ b/app/services/web_hook_service.rb @@ -63,7 +63,7 @@ class WebHookService end def async_execute - Sidekiq::Client.enqueue(WebHookWorker, hook.id, data, hook_name) + WebHookWorker.perform_async(hook.id, data, hook_name) end private |