Class: MHV::PhrUpdateJob

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/sidekiq/mhv/phr_update_job.rb

Instance Method Summary collapse

Instance Method Details

#handle_errors(e) ⇒ Object (private)



32
33
34
# File 'app/sidekiq/mhv/phr_update_job.rb', line 32

def handle_errors(e)
  Rails.logger.error("MHV PHR refresh failed: #{e.message}", e)
end

#mhv_user?(mhv_correlation_id) ⇒ Boolean (private)

Returns:

  • (Boolean)


28
29
30
# File 'app/sidekiq/mhv/phr_update_job.rb', line 28

def mhv_user?(mhv_correlation_id)
  mhv_correlation_id.present?
end

#perform(icn, mhv_correlation_id) ⇒ Object



15
16
17
18
19
# File 'app/sidekiq/mhv/phr_update_job.rb', line 15

def perform(icn, mhv_correlation_id)
  run_refresh(icn) if mhv_user?(mhv_correlation_id)
rescue => e
  handle_errors(e)
end

#run_refresh(icn) ⇒ Object (private)



23
24
25
26
# File 'app/sidekiq/mhv/phr_update_job.rb', line 23

def run_refresh(icn)
  phr_client = PHRMgr::Client.new(icn)
  phr_client.post_phrmgr_refresh
end