Skip to content

Instantly share code, notes, and snippets.

@jspillers
Created April 8, 2011 20:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jspillers/910670 to your computer and use it in GitHub Desktop.
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
# 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