Class: Plantae::ActiveJobAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/plantae/active_job_adapter.rb

Instance Method Summary collapse

Instance Method Details

#enqueue(job) ⇒ Object



5
6
7
# File 'lib/plantae/active_job_adapter.rb', line 5

def enqueue(job)
  job.perform_now
end

#enqueue_at(job, timestamp) ⇒ Object



9
10
11
12
# File 'lib/plantae/active_job_adapter.rb', line 9

def enqueue_at(job, timestamp)
  raise 'cannot handle jobs this far in the future' if Time.current.to_f - timestamp > 2
  job.perform_now
end