Skip to content

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

FIX: Set `Jobs::BackfillSidebarSiteSettings` cluster concurrency to 1 (#22316)

Alan Guo Xiang Tan0d1d70721300
diff --git a/app/jobs/regular/backfill_sidebar_site_settings.rb b/app/jobs/regular/backfill_sidebar_site_settings.rb
index 9313a9afcab..2489d5debea 100644
--- a/app/jobs/regular/backfill_sidebar_site_settings.rb
+++ b/app/jobs/regular/backfill_sidebar_site_settings.rb
@@ -1,6 +1,10 @@
# frozen_string_literal: true
class Jobs::BackfillSidebarSiteSettings < Jobs::Base
+ # There should only be one of these jobs running at a time and it will be ordered based on the order in which the job
+ # was enqueued.
+ cluster_concurrency 1
+
def execute(args)
SidebarSiteSettingsBackfiller.new(
args[:setting_name],
diff --git a/spec/jobs/backfill_sidebar_site_settings_spec.rb b/spec/jobs/backfill_sidebar_site_settings_spec.rb
new file mode 100644
index 00000000000..22efce29cce
--- /dev/null
+++ b/spec/jobs/backfill_sidebar_site_settings_spec.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+RSpec.describe Jobs::BackfillSidebarSiteSettings do
+ it "should have a cluster concurrency of 1" do
+ expect(Jobs::BackfillSidebarSiteSettings.get_cluster_concurrency).to eq(1)
+ end
+end