Sha256: 48847f04ac8cf9180b4c7ef50b1e1aa8dfaa52541ee8c446aa14777c8a22e022

Contents?: true

Size: 562 Bytes

Versions: 2

Compression:

Stored size: 562 Bytes

Contents

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

namespace :resque do
  task :setup

  desc "Start Resque Scheduler"
  task :scheduler => :scheduler_setup do
    require 'resque'
    require 'resque_scheduler'

    File.open(ENV['PIDFILE'], 'w') { |f| f << Process.pid.to_s } if ENV['PIDFILE']

    Resque::Scheduler.verbose = true if ENV['VERBOSE']
    Resque::Scheduler.run
  end

  task :scheduler_setup do
    if ENV['INITIALIZER_PATH']
      load ENV['INITIALIZER_PATH'].to_s.strip
    else
      Rake::Task['resque:setup'].invoke
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
resque-scheduler-2.0.0.d lib/resque_scheduler/tasks.rb
resque-scheduler-2.0.0.c lib/resque_scheduler/tasks.rb