Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Updated Gemfile, Rakefile #8

Closed
wants to merge 6 commits into from

4 participants

@christophercotton

When trying to use another gem that also required the Heroku gem, I found out that I couldn't use workless anymore. I went through and updated the Gemfile to have a better set of gems, including moving shoulda to the development and test group.

I've tested it out by running on Heroku with this new gem and it works fine. I didn't update the version number of the gem, since I figured you would do that.

@lostboy
Owner

Thanks for your suggestions, I've released v1.0.1 with support for dj 3, let me know how you get on, ill be looking to add some parallelism to the scalers like you suggested soon

@davidakachaos

I think this can be closed now?

@lostboy lostboy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 30, 2011
  1. @christophercotton

    updating the Jeweler task and Gemfile to create a better gemspec. Don…

    christophercotton authored
    …'t require specific version of the Herkou gem. Shoulda should only be for dev/testing
  2. @christophercotton
Commits on Aug 11, 2011
  1. @sorens

    increase the number of workers when the jobs.count is over 500 and th…

    sorens authored
    …ere are less than 2 workers running
  2. @sorens

    ramp up at 200 jobs, not 500

    sorens authored
Commits on Sep 6, 2011
  1. @sorens
Commits on Apr 11, 2012
  1. @sorens

    manually merge upstream changes

    sorens authored
This page is out of date. Refresh to see the latest.
View
2  .gitignore
@@ -22,4 +22,4 @@ rdoc
pkg
## PROJECT::SPECIFIC
-Gemfile.lock
+.bundle
View
4 Gemfile
@@ -1,3 +1,3 @@
-source :gemcutter
+source :rubygems
-gemspec
+gemspec
View
13 lib/workless/scalers/heroku.rb
@@ -8,12 +8,17 @@ class Heroku < Base
extend Delayed::Workless::Scaler::HerokuClient
- def self.up
- client.set_workers(ENV['APP_NAME'], 1) if self.workers == 0
+ def up
+ w = workers
+ if w == 0
+ client.set_workers(ENV['APP_NAME'], 1)
+ elsif w < 2 and jobs.count > 200
+ client.set_workers(ENV['APP_NAME'], 10)
+ end
end
- def self.down
- client.set_workers(ENV['APP_NAME'], 0) unless self.workers == 0 or self.jobs.count > 0
+ def down
+ client.set_workers(ENV['APP_NAME'], 0) unless jobs.count > 0
end
def self.workers
View
9 lib/workless/scalers/local.rb
@@ -7,6 +7,15 @@ module Scaler
class Local < Base
def self.up
+
+ # if workers == 0
+ # Rush::Box.new[Rails.root].bash("rake jobs:work", :background => true)
+ # elsif workers < 2 and jobs.count > 200
+ # for i in (1..10)
+ # Rush::Box.new[Rails.root].bash("rake jobs:work", :background => true)
+ # end
+ # end
+
if self.workers == 0
Rush::Box.new[Rails.root].bash("script/delayed_job start -i workless", :background => true)
sleep 1
Something went wrong with that request. Please try again.