From 3a3eed5a078ebc4061cbe7f06a09d7f8297c515b Mon Sep 17 00:00:00 2001 From: Derek Fong <151783381+dfong-adh@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:15:03 -0800 Subject: [PATCH 1/2] 99019: Add deprecation warning for DR non-engine scheduled jobs and remove from periodic jobs --- .../decision_review/delete_saved_claim_records_job.rb | 2 ++ .../decision_review/failure_notification_email_job.rb | 2 ++ app/sidekiq/decision_review/hlr_status_updater_job.rb | 5 +++++ app/sidekiq/decision_review/nod_status_updater_job.rb | 5 +++++ app/sidekiq/decision_review/sc_status_updater_job.rb | 5 +++++ lib/periodic_jobs.rb | 11 ----------- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/app/sidekiq/decision_review/delete_saved_claim_records_job.rb b/app/sidekiq/decision_review/delete_saved_claim_records_job.rb index f03b3148784..946807076de 100644 --- a/app/sidekiq/decision_review/delete_saved_claim_records_job.rb +++ b/app/sidekiq/decision_review/delete_saved_claim_records_job.rb @@ -12,6 +12,8 @@ class DeleteSavedClaimRecordsJob STATSD_KEY_PREFIX = 'worker.decision_review.delete_saved_claim_records' def perform + Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + return unless enabled? deleted_records = ::SavedClaim.where(delete_date: ..DateTime.now).destroy_all diff --git a/app/sidekiq/decision_review/failure_notification_email_job.rb b/app/sidekiq/decision_review/failure_notification_email_job.rb index 52101894362..e6d49b16718 100644 --- a/app/sidekiq/decision_review/failure_notification_email_job.rb +++ b/app/sidekiq/decision_review/failure_notification_email_job.rb @@ -20,6 +20,8 @@ class FailureNotificationEmailJob STATSD_KEY_PREFIX = 'worker.decision_review.failure_notification_email' def perform + Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + return unless should_perform? send_form_emails diff --git a/app/sidekiq/decision_review/hlr_status_updater_job.rb b/app/sidekiq/decision_review/hlr_status_updater_job.rb index f568c8d4944..4635ad73488 100644 --- a/app/sidekiq/decision_review/hlr_status_updater_job.rb +++ b/app/sidekiq/decision_review/hlr_status_updater_job.rb @@ -4,6 +4,11 @@ module DecisionReview class HlrStatusUpdaterJob < SavedClaimStatusUpdaterJob + def perform + Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + super + end + private def records_to_update diff --git a/app/sidekiq/decision_review/nod_status_updater_job.rb b/app/sidekiq/decision_review/nod_status_updater_job.rb index dce7e857bce..936edd1bece 100644 --- a/app/sidekiq/decision_review/nod_status_updater_job.rb +++ b/app/sidekiq/decision_review/nod_status_updater_job.rb @@ -4,6 +4,11 @@ module DecisionReview class NodStatusUpdaterJob < SavedClaimStatusUpdaterJob + def perform + Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + super + end + private def records_to_update diff --git a/app/sidekiq/decision_review/sc_status_updater_job.rb b/app/sidekiq/decision_review/sc_status_updater_job.rb index 0082bdb2768..df761d86c67 100644 --- a/app/sidekiq/decision_review/sc_status_updater_job.rb +++ b/app/sidekiq/decision_review/sc_status_updater_job.rb @@ -4,6 +4,11 @@ module DecisionReview class ScStatusUpdaterJob < SavedClaimStatusUpdaterJob + def perform + Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + super + end + private def records_to_update diff --git a/lib/periodic_jobs.rb b/lib/periodic_jobs.rb index e1e8273f2c0..345c0b8f2ce 100644 --- a/lib/periodic_jobs.rb +++ b/lib/periodic_jobs.rb @@ -226,25 +226,14 @@ # Every 15min job that sends missing Pega statuses to DataDog mgr.register('*/15 * * * *', 'IvcChampva::MissingFormStatusJob') - # Hourly jobs that update DR SavedClaims with delete_date - mgr.register('20 * * * *', 'DecisionReview::HlrStatusUpdaterJob') - mgr.register('30 * * * *', 'DecisionReview::NodStatusUpdaterJob') - mgr.register('50 * * * *', 'DecisionReview::ScStatusUpdaterJob') - # Engine version: Hourly jobs that update DR SavedClaims with delete_date mgr.register('10 * * * *', 'DecisionReviews::HlrStatusUpdaterJob') mgr.register('15 * * * *', 'DecisionReviews::NodStatusUpdaterJob') mgr.register('40 * * * *', 'DecisionReviews::ScStatusUpdaterJob') - # Clean SavedClaim records that are past delete date - mgr.register('0 7 * * *', 'DecisionReview::DeleteSavedClaimRecordsJob') - # Engine version: Clean SavedClaim records that are past delete date mgr.register('0 5 * * *', 'DecisionReviews::DeleteSavedClaimRecordsJob') - # Send Decision Review emails to Veteran for failed form/evidence submissions - mgr.register('5 1 * * *', 'DecisionReview::FailureNotificationEmailJob') - # Engine version: Send Decision Review emails to Veteran for failed form/evidence submissions mgr.register('5 0 * * *', 'DecisionReviews::FailureNotificationEmailJob') From 54d02c26cec39212d026319d222dc38e313520e4 Mon Sep 17 00:00:00 2001 From: Derek Fong <151783381+dfong-adh@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:14:39 -0800 Subject: [PATCH 2/2] Changes per code review --- app/sidekiq/decision_review/delete_saved_claim_records_job.rb | 2 +- app/sidekiq/decision_review/failure_notification_email_job.rb | 2 +- app/sidekiq/decision_review/hlr_status_updater_job.rb | 2 +- app/sidekiq/decision_review/nod_status_updater_job.rb | 2 +- app/sidekiq/decision_review/sc_status_updater_job.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/sidekiq/decision_review/delete_saved_claim_records_job.rb b/app/sidekiq/decision_review/delete_saved_claim_records_job.rb index 946807076de..38b0784387d 100644 --- a/app/sidekiq/decision_review/delete_saved_claim_records_job.rb +++ b/app/sidekiq/decision_review/delete_saved_claim_records_job.rb @@ -12,7 +12,7 @@ class DeleteSavedClaimRecordsJob STATSD_KEY_PREFIX = 'worker.decision_review.delete_saved_claim_records' def perform - Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + ActiveSupport::Deprecation.new.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") return unless enabled? diff --git a/app/sidekiq/decision_review/failure_notification_email_job.rb b/app/sidekiq/decision_review/failure_notification_email_job.rb index e6d49b16718..45d7e0bafd6 100644 --- a/app/sidekiq/decision_review/failure_notification_email_job.rb +++ b/app/sidekiq/decision_review/failure_notification_email_job.rb @@ -20,7 +20,7 @@ class FailureNotificationEmailJob STATSD_KEY_PREFIX = 'worker.decision_review.failure_notification_email' def perform - Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + ActiveSupport::Deprecation.new.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") return unless should_perform? diff --git a/app/sidekiq/decision_review/hlr_status_updater_job.rb b/app/sidekiq/decision_review/hlr_status_updater_job.rb index 4635ad73488..eaaf36a4c74 100644 --- a/app/sidekiq/decision_review/hlr_status_updater_job.rb +++ b/app/sidekiq/decision_review/hlr_status_updater_job.rb @@ -5,7 +5,7 @@ module DecisionReview class HlrStatusUpdaterJob < SavedClaimStatusUpdaterJob def perform - Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + ActiveSupport::Deprecation.new.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") super end diff --git a/app/sidekiq/decision_review/nod_status_updater_job.rb b/app/sidekiq/decision_review/nod_status_updater_job.rb index 936edd1bece..0d89b1ce999 100644 --- a/app/sidekiq/decision_review/nod_status_updater_job.rb +++ b/app/sidekiq/decision_review/nod_status_updater_job.rb @@ -5,7 +5,7 @@ module DecisionReview class NodStatusUpdaterJob < SavedClaimStatusUpdaterJob def perform - Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + ActiveSupport::Deprecation.new.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") super end diff --git a/app/sidekiq/decision_review/sc_status_updater_job.rb b/app/sidekiq/decision_review/sc_status_updater_job.rb index df761d86c67..472ea067666 100644 --- a/app/sidekiq/decision_review/sc_status_updater_job.rb +++ b/app/sidekiq/decision_review/sc_status_updater_job.rb @@ -5,7 +5,7 @@ module DecisionReview class ScStatusUpdaterJob < SavedClaimStatusUpdaterJob def perform - Rails.logger.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") + ActiveSupport::Deprecation.new.warn("#{self.class.name} job is deprecated and will be replaced by DR engine job") super end