lib/autoscale/heroku.rb in heroku-qc-autoscale-0.0.4 vs lib/autoscale/heroku.rb in heroku-qc-autoscale-0.0.5
- old
+ new
@@ -24,12 +24,12 @@
end
# shutdown if no jobs exist
def down
if job_count < 1
- QC.log(action: :scale, workers: 0)
- self.workers = 0
+ QC.log(action: :scale, workers: min_workers)
+ self.workers = min_workers
end
end
def calculate_required_workers
scale.rindex{|x| x <= job_count} + 1
@@ -48,9 +48,13 @@
end
# the scale
def scale
Autoscale.scale || [1, 15, 30, 40, 50]
+ end
+
+ def min_workers
+ Autoscale.min || 0
end
# heroku api client
def client
@@client ||= ::Heroku::API.new( params )
\ No newline at end of file