delayed_job_worker.rb 228 B

12345678910111213141516
  1. class DelayedJobWorker < LongRunnable::Worker
  2. include LongRunnable
  3. def run
  4. @dj = Delayed::Worker.new
  5. @dj.start
  6. end
  7. def stop
  8. @dj.stop if @dj
  9. end
  10. def self.setup_worker
  11. [new(id: self.to_s)]
  12. end
  13. end