Permalink
Browse files

Updating scheduler_setup and readme

  • Loading branch information...
1 parent 68b1b03 commit 08f168c20ad73d7cfeb148d7b0989497b8080d48 @chewbranca committed Aug 11, 2010
Showing with 12 additions and 4 deletions.
  1. +6 −0 README.markdown
  2. +6 −4 lib/resque_scheduler/tasks.rb
View
@@ -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:
@@ -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 08f168c

Please sign in to comment.