Merge pull request #2768 from rlaneve/feature/queued-web-hooks
Updates web hooks to process via queue
This commit is contained in:
commit
552e42f634
5 changed files with 16 additions and 3 deletions
|
@ -340,7 +340,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def execute_hooks(data)
|
||||
hooks.each { |hook| hook.execute(data) }
|
||||
hooks.each { |hook| hook.async_execute(data) }
|
||||
end
|
||||
|
||||
def execute_services(data)
|
||||
|
|
|
@ -34,4 +34,8 @@ class WebHook < ActiveRecord::Base
|
|||
basic_auth: {username: parsed_url.user, password: parsed_url.password})
|
||||
end
|
||||
end
|
||||
|
||||
def async_execute(data)
|
||||
Sidekiq::Client.enqueue(ProjectWebHookWorker, id, data)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue