Class: Flightdeck::RecurringCatalog

Inherits:
Object
  • Object
show all
Defined in:
app/models/flightdeck/recurring_catalog.rb

Overview

The recurring schedule: every task, when it last ran, how that run went, and when it is due next.

"Next run" comes from the task's own Fugit-backed API rather than from a calculation of ours, so Flightdeck and the scheduler can never disagree about when something is due.

Defined Under Namespace

Classes: Row

Instance Method Summary collapse

Instance Method Details

#any?Boolean

Returns:

  • (Boolean)


61
# File 'app/models/flightdeck/recurring_catalog.rb', line 61

def any? = rows.any?

#find(id) ⇒ Object



57
58
59
# File 'app/models/flightdeck/recurring_catalog.rb', line 57

def find(id)
  rows.find { |row| row.id == id.to_i }
end

#rowsObject



44
45
46
47
48
49
50
51
52
53
54
55
# File 'app/models/flightdeck/recurring_catalog.rb', line 44

def rows
  @rows ||= tasks.map do |task|
    run = last_runs[task.key]

    Row.new(
      task: task,
      last_run_at: run&.first,
      last_job_id: run&.last,
      last_status: status_for(run&.last)
    )
  end
end