Class: Renalware::HD::Scheduling::DiaryHousekeepingJob

Inherits:
Struct
  • Object
show all
Defined in:
app/models/renalware/hd/scheduling/diary_housekeeping_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#up_untilObject

Returns the value of attribute up_until

Returns:

  • (Object)

    the current value of up_until



16
17
18
# File 'app/models/renalware/hd/scheduling/diary_housekeeping_job.rb', line 16

def up_until
  @up_until
end

Instance Method Details

#destroy_failed_jobs?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'app/models/renalware/hd/scheduling/diary_housekeeping_job.rb', line 29

def destroy_failed_jobs?
  true
end

#max_attemptsObject



17
18
19
# File 'app/models/renalware/hd/scheduling/diary_housekeeping_job.rb', line 17

def max_attempts
  1
end

#performObject

:reek:UtilityFunction



34
35
36
37
38
39
40
# File 'app/models/renalware/hd/scheduling/diary_housekeeping_job.rb', line 34

def perform
  up_until ||= Time.zone.today - 1.day
  up_until = up_until.to_date
  create_missing_weekly_diaries
  move_elapsed_master_slots_into_weekly_slot_equivalent
  archive_old_weekly_slots(up_until)
end

#priorityObject



25
26
27
# File 'app/models/renalware/hd/scheduling/diary_housekeeping_job.rb', line 25

def priority
  5 # medium
end

#queue_nameObject



21
22
23
# File 'app/models/renalware/hd/scheduling/diary_housekeeping_job.rb', line 21

def queue_name
  "hd_diary_houskeeping"
end