Sha256: 85e76c75e3eaad3e1620f086fef3c1c0b2622ab8989125cf836d494e9804a5d3

Contents?: true

Size: 640 Bytes

Versions: 4

Compression:

Stored size: 640 Bytes

Contents

# require 'resque/tasks'
# will give you the resque tasks

namespace :resque do
  desc "Start a Resque Ranger"
  task :work do
    Rake::Task['resque:setup'].invoke rescue nil

    worker = nil
    queues = (ENV['QUEUES'] || ENV['QUEUE']).to_s.split(',')

    begin
      worker = Resque::Worker.new(*queues)
      worker.verbose = ENV['LOGGING'] || ENV['VERBOSE']
      worker.very_verbose = ENV['VVERBOSE']
    rescue Resque::NoQueueError
      abort "set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work"
    end

    puts "*** Starting worker #{worker}"

    worker.work(ENV['INTERVAL'] || 5) # interval, will block
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
jerefrer-resque-1.1.0 lib/resque/tasks.rb
resque-1.1.0 lib/resque/tasks.rb
resque-1.0.0 lib/resque/tasks.rb
resque-0.2.0 lib/resque/tasks.rb