Skip to content

Instantly share code, notes, and snippets.

@chewbranca
Created August 7, 2010 04:02
Show Gist options
  • Save chewbranca/512410 to your computer and use it in GitHub Desktop.
Save chewbranca/512410 to your computer and use it in GitHub Desktop.
# require 'resque/tasks'
# will give you the resque tasks
namespace :resque do
task :setup
desc "Start Resque Scheduler"
task :scheduler => :scheduler_setup do |t,args|
require 'resque'
require 'resque_scheduler'
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment