Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactored local scaler handling

  • Loading branch information...
commit 5695cac3031e46c1252acbe5a657b5f732bdd4b3 1 parent 2550b0b
@lostboy authored
Showing with 11 additions and 6 deletions.
  1. +1 −1  VERSION
  2. +8 −3 lib/workless/scalers/local.rb
  3. +2 −2 workless.gemspec
View
2  VERSION
@@ -1 +1 @@
-1.0.0
+1.0.1
View
11 lib/workless/scalers/local.rb
@@ -7,17 +7,22 @@ module Scaler
class Local < Base
def self.up
- Rush::Box.new[Rails.root].bash("rake jobs:work", :background => true) if self.workers == 0
+ if self.workers == 0
+ Rush::Box.new[Rails.root].bash("script/delayed_job start -i workless", :background => true)
+ sleep 1
+ end
true
end
def self.down
- $exit = true unless jobs.count > 0
+ unless jobs.count > 0 and workers > 0
+ Rush::Box.new[Rails.root].bash("script/delayed_job stop -i workless", :background => true)
+ end
true
end
def self.workers
- Rush::Box.new.processes.filter(:cmdline => /rake jobs:work/).size
+ Rush::Box.new.processes.filter(:cmdline => /delayed_job start -i workless|delayed_job.workless/).size
end
end
View
4 workless.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{workless}
- s.version = "1.0.0"
+ s.version = "1.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
s.authors = ["lostboy"]
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.description = %q{Extension to Delayed Job to enable workers to scale up when needed}
s.email = %q{paul.crabtree@gmail.com}
- s.files = Dir.glob("{rails,lib}/**/*") + %w(LICENSE README.md)
+ s.files = Dir.glob("{rails,lib}/**/*") + %w(LICENSE README.md )
s.homepage = %q{http://github.com/lostboy/workless}
s.require_paths = ["lib"]
Please sign in to comment.
Something went wrong with that request. Please try again.