Class: HttpHealthCheck::Probes::DelayedJob

Inherits:
Object
  • Object
show all
Includes:
HttpHealthCheck::Probe
Defined in:
lib/http_health_check/probes/delayed_job.rb

Defined Under Namespace

Classes: HealthCheckJob

Instance Method Summary collapse

Methods included from HttpHealthCheck::Probe

#call, #meta, #probe_error, #probe_ok, #with_error_handler

Constructor Details

#initialize(delayed_job: ::Delayed::Job) ⇒ DelayedJob

Returns a new instance of DelayedJob.



15
16
17
# File 'lib/http_health_check/probes/delayed_job.rb', line 15

def initialize(delayed_job: ::Delayed::Job)
  @delayed_job = delayed_job
end

Instance Method Details

#probe(_env) ⇒ Object



19
20
21
22
23
# File 'lib/http_health_check/probes/delayed_job.rb', line 19

def probe(_env)
  @delayed_job.where(queue: HealthCheckJob.queue_name).each(&:destroy!)
  @delayed_job.enqueue(HealthCheckJob).destroy!
  probe_ok
end