This would be a nice convenience, when Litejob is used in the context of a Rails application. Maybe the adaptation needs to live in a Railtie or elsewhere?
class PretenderJob < ApplicationJob
queue_as :default
def perform(*args)
Rails.logger.info "Pretender starting... #{args.inspect}"
sleep 5
Rails.logger.info "Pretender stopping #{args.inspect}"
end
end
This would be a nice convenience, when Litejob is used in the context of a Rails application. Maybe the adaptation needs to live in a Railtie or elsewhere?
The easiest way to achieve this involves using
.perform_at
and usingTime#from_now
: