From 8421ed8fc9cb34b48bc771c1d89ab414721dedb3 Mon Sep 17 00:00:00 2001 From: Bryan Thompson <18094023+SnowboardTechie@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:45:09 -0800 Subject: [PATCH] add job to 10m rotation --- lib/periodic_jobs.rb | 3 +++ .../banners/{update_all_banners.rb => update_all_job.rb} | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) rename modules/banners/app/sidekiq/banners/{update_all_banners.rb => update_all_job.rb} (90%) diff --git a/lib/periodic_jobs.rb b/lib/periodic_jobs.rb index 205d2817977..8fb7ebc2ead 100644 --- a/lib/periodic_jobs.rb +++ b/lib/periodic_jobs.rb @@ -48,6 +48,9 @@ # Checks status of Flipper features expected to be enabled and alerts to Slack if any are not enabled mgr.register('0 2,9,16 * * 1-5', 'AppealsApi::FlipperStatusAlert') + # Update alternative Banners data every 10 minutes + mgr.register('*/10 * * * *', 'Banners::UpdateAll') + # Update static data cache mgr.register('0 0 * * *', 'Crm::TopicsDataJob') diff --git a/modules/banners/app/sidekiq/banners/update_all_banners.rb b/modules/banners/app/sidekiq/banners/update_all_job.rb similarity index 90% rename from modules/banners/app/sidekiq/banners/update_all_banners.rb rename to modules/banners/app/sidekiq/banners/update_all_job.rb index 4c4d9caac8e..5daded94b51 100644 --- a/modules/banners/app/sidekiq/banners/update_all_banners.rb +++ b/modules/banners/app/sidekiq/banners/update_all_job.rb @@ -1,12 +1,12 @@ -require 'sidekiq' +# frozen_string_literal: true module Banners - class UpdateAllBanners + class UpdateAllJob include Sidekiq::Job STATSD_KEY_PREFIX = 'banners.sidekiq.update_all_banners' - sidekiq_options retry: 7 + sidekiq_options retry: 5 sidekiq_retries_exhausted do |msg, _ex| job_id = msg['jid'] @@ -51,7 +51,7 @@ def perform private def enabled? - true #should consider bringing in a flipper here + true #should consider bringing in a flipper heres end end end