PERF: Select distinct active web hooks at the db level.
This commit is contained in:
parent
4fef9e95d2
commit
8a1aab4e8a
|
@ -38,7 +38,7 @@ class WebHook < ActiveRecord::Base
|
|||
WebHook.where(active: true)
|
||||
.joins(:web_hook_event_types)
|
||||
.where("web_hooks.wildcard_web_hook = ? OR web_hook_event_types.name = ?", true, type.to_s)
|
||||
.uniq
|
||||
.distinct
|
||||
end
|
||||
|
||||
def self.enqueue_hooks(type, opts = {}, web_hooks = nil)
|
||||
|
|
Loading…
Reference in New Issue