Class: Renalware::HD::UpdateRollingPatientStatisticsDjJob

Inherits:
Struct
  • Object
show all
Defined in:
app/jobs/renalware/hd/update_rolling_patient_statistics_dj_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#patient_idObject

Returns the value of attribute patient_id

Returns:

  • (Object)

    the current value of patient_id



10
11
12
# File 'app/jobs/renalware/hd/update_rolling_patient_statistics_dj_job.rb', line 10

def patient_id
  @patient_id
end

Instance Method Details

#destroy_failed_jobs?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/jobs/renalware/hd/update_rolling_patient_statistics_dj_job.rb', line 28

def destroy_failed_jobs?
  true
end

#max_attemptsObject



16
17
18
# File 'app/jobs/renalware/hd/update_rolling_patient_statistics_dj_job.rb', line 16

def max_attempts
  2
end

#performObject



11
12
13
14
# File 'app/jobs/renalware/hd/update_rolling_patient_statistics_dj_job.rb', line 11

def perform
  patient = Renalware::HD::Patient.find(patient_id)
  UpdateRollingPatientStatistics.new(patient: patient).call
end

#priorityObject



24
25
26
# File 'app/jobs/renalware/hd/update_rolling_patient_statistics_dj_job.rb', line 24

def priority
  4
end

#queue_nameObject



20
21
22
# File 'app/jobs/renalware/hd/update_rolling_patient_statistics_dj_job.rb', line 20

def queue_name
  "hd_patient_statistics"
end

#reschedule_at(current_time, attempts) ⇒ Object

Retry at intervals of 1, 2, 3 hours



33
34
35
# File 'app/jobs/renalware/hd/update_rolling_patient_statistics_dj_job.rb', line 33

def reschedule_at(current_time, attempts)
  current_time + attempts.hours
end