1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/test/support/integration/adapters/delayed_job.rb

21 lines
419 B
Ruby
Raw Normal View History

2014-08-18 03:19:41 -04:00
require 'delayed_job'
require 'delayed_job_active_record'
module DelayedJobJobsManager
def setup
ActiveJob::Base.queue_adapter = :delayed_job
end
def clear_jobs
Delayed::Job.delete_all
end
def start_workers
@worker = Delayed::Worker.new(quiet: true, sleep_delay: 0.5, queues: %w(integration_tests))
2014-08-18 03:19:41 -04:00
@thread = Thread.new { @worker.start }
end
def stop_workers
@worker.stop
end
end