Method moved to service
This commit is contained in:
parent
aa1780d03c
commit
99760edc75
|
@ -12,7 +12,4 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
class SystemHook < WebHook
|
class SystemHook < WebHook
|
||||||
def async_execute(data)
|
|
||||||
Sidekiq::Client.enqueue(SystemHookWorker, id, data)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,10 +7,14 @@ class SystemHooksService
|
||||||
|
|
||||||
def self.execute_hooks(data)
|
def self.execute_hooks(data)
|
||||||
SystemHook.all.each do |sh|
|
SystemHook.all.each do |sh|
|
||||||
sh.async_execute data
|
async_execute_hook sh, data
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.async_execute_hook(hook, data)
|
||||||
|
Sidekiq::Client.enqueue(SystemHookWorker, hook, data)
|
||||||
|
end
|
||||||
|
|
||||||
def self.build_event_data(model, event)
|
def self.build_event_data(model, event)
|
||||||
data = {
|
data = {
|
||||||
event_name: build_event_name(model, event),
|
event_name: build_event_name(model, event),
|
||||||
|
|
Loading…
Reference in a new issue