Skip to content

A platform for community discussion. Free, open, simple.

PERF: Select distinct active web hooks at the db level.

Guo Xiang Tan8a1aab4e8a3f
diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb
index 257357c4eae..a5cda0ce03e 100644
--- a/app/models/web_hook.rb
+++ b/app/models/web_hook.rb
@@ -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)