class Mosquito::Api::PeriodicJob

Overview

An interface for inspecting the state of periodic jobs.

This class provides read-only access to periodic job metadata, including the last time each periodic job was executed.

Mosquito::Api::PeriodicJob.all.each do |job|
  puts "#{job.name} last ran at #{job.last_executed_at}"
end

Defined in:

mosquito/api/periodic_job.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(name : String, interval : Time::Span | Time::MonthSpan) #

Class Method Detail

def self.all : Array(self) #

Returns a list of all registered periodic jobs.


Instance Method Detail

def interval : Time::Span | Time::MonthSpan #

The configured run interval for this periodic job.


def last_executed_at : Time | Nil #

The last time this periodic job was executed, or nil if it has never run.


def name : String #

The name of the periodic job class.