Skip to content

Commit

Permalink
API-37857-adjust-retries-for-ews-sidekiq-job (#17438)
Browse files Browse the repository at this point in the history
* API-37857-adjust-retries-for-ews-sidekiq-job
* Addds 48 hour retry limit to evidence waiver builder job
* Adds 48 retry limit to ews updater job
* Adds test to relevant spec files for each

	modified:   modules/claims_api/app/sidekiq/claims_api/evidence_waiver_builder_job.rb
	modified:   modules/claims_api/app/sidekiq/claims_api/ews_updater.rb
	modified:   modules/claims_api/spec/sidekiq/evidence_waiver_builder_job_spec.rb
	modified:   modules/claims_api/spec/sidekiq/ews_updater_spec.rb

* Fixes incorrect test text description

* Update modules/claims_api/spec/sidekiq/ews_updater_spec.rb

Co-authored-by: Tyler <[email protected]>

---------

Co-authored-by: Tyler <[email protected]>
  • Loading branch information
rockwellwindsor-va and tycol7 authored Jul 9, 2024
1 parent 653d874 commit 1a7755d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
module ClaimsApi
class EvidenceWaiverBuilderJob < ClaimsApi::ServiceBase
include ClaimsApi::EwsVBMSSidekiq
sidekiq_options expires_in: 48.hours, retry: true

# Generate a 5103 "form" for a given veteran.
#
Expand Down
1 change: 1 addition & 0 deletions modules/claims_api/app/sidekiq/claims_api/ews_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module ClaimsApi
class EwsUpdater < ClaimsApi::ServiceBase
FILE_5103 = 'Y'
OMITTED_FIELDS = %w[contentions dvlpmt_items letters name status_messages station_profile stn_suspns_prfil].freeze
sidekiq_options expires_in: 48.hours, retry: true

def perform(ews_id)
ews = ClaimsApi::EvidenceWaiverSubmission.find(ews_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
end
end

describe 'when an errored job has a 48 hour time limitation' do
it 'expires in 48 hours' do
described_class.within_sidekiq_retries_exhausted_block do
expect(subject).to be_expired_in 48.hours
end
end
end

describe 'when an errored job has exhausted its retries' do
it 'logs to the ClaimsApi Logger' do
error_msg = 'An error occurred from the Evidence Waiver Builder Job'
Expand Down
8 changes: 8 additions & 0 deletions modules/claims_api/spec/sidekiq/ews_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
end
end

describe 'when an errored job has a 48 hour time limitation' do
it 'expires in 48 hours' do
described_class.within_sidekiq_retries_exhausted_block do
expect(subject).to be_expired_in 48.hours
end
end
end

context 'when an errored job has exhausted its retries' do
it 'logs to the ClaimsApi Logger' do
error_msg = 'An error occurred from the EWS Updater Job'
Expand Down

0 comments on commit 1a7755d

Please sign in to comment.