Skip to content
Snippets Groups Projects
Commit 99760edc authored by Andrew8xx8's avatar Andrew8xx8
Browse files

Method moved to service

parent aa1780d0
No related branches found
No related tags found
1 merge request!3052System hooks code & logic refactoring
Loading
Loading
@@ -12,7 +12,4 @@
#
 
class SystemHook < WebHook
def async_execute(data)
Sidekiq::Client.enqueue(SystemHookWorker, id, data)
end
end
Loading
Loading
@@ -7,10 +7,14 @@ class SystemHooksService
 
def self.execute_hooks(data)
SystemHook.all.each do |sh|
sh.async_execute data
async_execute_hook sh, data
end
end
 
def self.async_execute_hook(hook, data)
Sidekiq::Client.enqueue(SystemHookWorker, hook, data)
end
def self.build_event_data(model, event)
data = {
event_name: build_event_name(model, event),
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment