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

This job may notify hundreds of mods and take quite a while to run.

Co-authored-by: Sam <sam.saffron@gmail.com>
This commit is contained in:
Jeff Wong 2024-03-22 15:00:33 -07:00 committed by GitHub
parent 7d9c8993cd
commit 7e7b2cf7b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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])