Class: EVSS::DisabilityCompensationForm::SubmitForm8940

Inherits:
Job
  • Object
show all
Extended by:
Logging::ThirdPartyTransaction::MethodWrapper
Defined in:
app/sidekiq/evss/disability_compensation_form/submit_form8940.rb

Constant Summary collapse

STATSD_KEY_PREFIX =
'worker.evss.submit_form8940'
RETRY =

Sidekiq has built in exponential back-off functionality for retries A max retry attempt of 10 will result in a run time of ~8 hours This job is invoked from 526 background job

10

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging::ThirdPartyTransaction::MethodWrapper

wrap_with_logging

Methods included from Sidekiq::Form526JobStatusTracker::JobTracker

#job_success, #job_try, #non_retryable_error_handler, #retryable_error_handler, #with_tracking

Methods included from Sidekiq::Form526JobStatusTracker::BackupSubmission

#send_backup_submission_if_enabled

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger

Instance Attribute Details

#submission_idObject

Returns the value of attribute submission_id.



64
65
66
# File 'app/sidekiq/evss/disability_compensation_form/submit_form8940.rb', line 64

def submission_id
  @submission_id
end

Instance Method Details

#get_docs(submission_id) ⇒ Object



76
77
78
79
# File 'app/sidekiq/evss/disability_compensation_form/submit_form8940.rb', line 76

def get_docs(submission_id)
  @submission_id = submission_id
  { type: '21-8940', file: EVSS::DisabilityCompensationForm::Form8940Document.new(submission) }
end

#perform(submission_id) ⇒ Object

Performs an asynchronous job for generating and submitting 8940 PDF documents to VBMS

Parameters:



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'app/sidekiq/evss/disability_compensation_form/submit_form8940.rb', line 85

def perform(submission_id)
  @submission_id = submission_id
  Raven.tags_context(source: '526EZ-all-claims')

  super(submission_id)

  with_tracking('Form8940 Submission', submission.saved_claim_id, submission_id) do
    upload_to_vbms
  end
rescue => e
  # Cannot move job straight to dead queue dynamically within an executing job
  # raising error for all the exceptions as sidekiq will then move into dead queue
  # after all retries are exhausted
  retryable_error_handler(e)
  raise e
end