Created
April 8, 2011 20:35
-
-
Save jspillers/910670 to your computer and use it in GitHub Desktop.
Allows each resque worker class to be given auto scaling via config/initializers/resque.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# my app had quite a few different worker classes so | |
# i decided to extend them all from one place: | |
# config/initializers/resque.rb | |
if Rails.env == "production" || Rails.env == "staging" | |
resque_klasses = [ | |
SomeJob, | |
AnotherJob, | |
VeryHardWork, | |
PrettyEasyJobHere | |
] | |
resque_klasses.each do |klass| | |
klass.class_eval do | |
extend HerokuResqueAutoScale | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment