Skip to content

Commit

Permalink
Updating scheduler_setup and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chewbranca authored and bvandenbos committed Aug 13, 2010
1 parent 6efc07a commit 74bf722
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ NOTE: If you have added the 2 lines bellow to your Rails Rakefile
and you don't have to specify RAILS_ENV if the var is correctly set in
environment.rb

Alternatively, you can use your resque initializer to avoid loading the entire
rails stack.

$ rake resque:scheduler INITIALIZER_PATH=config/initializers/resque.rb


Multiple envs are allowed, separated by commas:

create_fake_leaderboards:
Expand Down
10 changes: 6 additions & 4 deletions lib/resque_scheduler/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@
task :setup

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

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

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

end

0 comments on commit 74bf722

Please sign in to comment.