Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating scheduler_setup and readme

  • Loading branch information...
commit 08f168c20ad73d7cfeb148d7b0989497b8080d48 1 parent 68b1b03
@chewbranca authored
Showing with 12 additions and 4 deletions.
  1. +6 −0 README.markdown
  2. +6 −4 lib/resque_scheduler/tasks.rb
View
6 README.markdown
@@ -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:
View
10 lib/resque_scheduler/tasks.rb
@@ -5,7 +5,7 @@
task :setup
desc "Start Resque Scheduler"
- task :scheduler => :scheduler_setup do |t,args|
+ task :scheduler => :scheduler_setup do
require 'resque'
require 'resque_scheduler'
@@ -13,10 +13,12 @@
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
Please sign in to comment.
Something went wrong with that request. Please try again.