aj1215
4/8/2011 - 8:35 PM

Allows each resque worker class to be given auto scaling via config/initializers/resque.rb

Allows each resque worker class to be given auto scaling via config/initializers/resque.rb

# 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