mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
d7a058f785
In passing, avoid a blind retry in QC: instead, just fix the problem.
20 lines
419 B
Ruby
20 lines
419 B
Ruby
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))
|
|
@thread = Thread.new { @worker.start }
|
|
end
|
|
|
|
def stop_workers
|
|
@worker.stop
|
|
end
|
|
end
|