Sha256: 675d89c9a76fa1e9e2426dd7c0a8b11c128d7881ddb00af72ceb33b47c64415f

Contents?: true

Size: 735 Bytes

Versions: 2

Compression:

Stored size: 735 Bytes

Contents

namespace :jobs do
  desc "Clear the delayed_job queue."
  task :clear => :environment do
    Delayed::Job.delete_all
  end

  desc "Start a delayed_job worker."
  task :work => :environment_options do
    Delayed::Worker.new(@worker_options).start
  end

  desc "Start a delayed_job worker and exit when all available jobs are complete."
  task :workoff => :environment_options do
    Delayed::Worker.new(@worker_options.merge({:exit_on_complete => true})).start
  end

  task :environment_options => :environment do
    @worker_options = {
      :min_priority => ENV['MIN_PRIORITY'],
      :max_priority => ENV['MAX_PRIORITY'],
      :queues => (ENV['QUEUES'] || ENV['QUEUE'] || '').split(','),
      :quiet => false
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
delayed_job-4.0.0.beta1 lib/delayed/tasks.rb
delayed_job-3.0.5 lib/delayed/tasks.rb