Class: Flightdeck::RecurringCatalog::Row

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#last_job_idObject

Returns the value of attribute last_job_id

Returns:

  • (Object)

    the current value of last_job_id



11
12
13
# File 'app/models/flightdeck/recurring_catalog.rb', line 11

def last_job_id
  @last_job_id
end

#last_run_atObject

Returns the value of attribute last_run_at

Returns:

  • (Object)

    the current value of last_run_at



11
12
13
# File 'app/models/flightdeck/recurring_catalog.rb', line 11

def last_run_at
  @last_run_at
end

#last_statusObject

Returns the value of attribute last_status

Returns:

  • (Object)

    the current value of last_status



11
12
13
# File 'app/models/flightdeck/recurring_catalog.rb', line 11

def last_status
  @last_status
end

#taskObject

Returns the value of attribute task

Returns:

  • (Object)

    the current value of task



11
12
13
# File 'app/models/flightdeck/recurring_catalog.rb', line 11

def task
  @task
end

Instance Method Details

#descriptionObject



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

def description = task.description

#ever_run?Boolean

Returns:

  • (Boolean)


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

def ever_run? = last_run_at.present?

#failed?Boolean

Returns:

  • (Boolean)


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

def failed? = last_status == :failed

#human_scheduleObject



24
25
26
# File 'app/models/flightdeck/recurring_catalog.rb', line 24

def human_schedule
  CronSchedule.humanize(schedule)
end

#idObject



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

def id = task.id

#job_classObject



20
21
22
# File 'app/models/flightdeck/recurring_catalog.rb', line 20

def job_class
  task.class_name.presence || task.command.presence || "(command)"
end

#keyObject



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

def key = task.key

#next_run_atObject

Fugit raises on schedules it cannot parse. A task that is on screen but unparseable should show "—" rather than take the page down.



30
31
32
33
34
# File 'app/models/flightdeck/recurring_catalog.rb', line 30

def next_run_at
  @next_run_at ||= task.next_time
rescue StandardError
  nil
end

#next_run_inObject



36
37
38
# File 'app/models/flightdeck/recurring_catalog.rb', line 36

def next_run_in
  next_run_at && next_run_at - Time.current
end

#priorityObject



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

def priority = task.priority

#queue_nameObject



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

def queue_name = task.queue_name

#scheduleObject



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

def schedule = task.schedule

#static?Boolean

Returns:

  • (Boolean)


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

def static? = task.static?