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

This job may notify hundreds of mods and take quite a while to run.
This commit is contained in:
Sam 2024-03-23 08:37:06 +11:00 committed by GitHub
parent d52abe2324
commit 0ed1b4537b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

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