Skip to content

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

PERF: only allow one reviewable notification at a time (#26330)

Sam0ed1b4537b28
diff --git a/app/jobs/regular/notify_reviewable.rb b/app/jobs/regular/notify_reviewable.rb
index ed8bdbc8509..8a5c35f641b 100644
--- a/app/jobs/regular/notify_reviewable.rb
+++ b/app/jobs/regular/notify_reviewable.rb
@@ -1,6 +1,10 @@
# frozen_string_literal: true
class Jobs::NotifyReviewable < ::Jobs::Base
+ # this job can take a very long time if there are many mods
+ # do not swamp the queue with it
+ cluster_concurrency 1
+
def execute(args)
return unless reviewable = Reviewable.find_by(id: args[:reviewable_id])