Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

support multi-application

  • Loading branch information...
commit 7f35a544e31f1c1223d062c781afd9991bd4dd94 1 parent b0a2485
@hsbt authored
View
30 lib/generators/heroku_scale_scheduler/templates/heroku_ps.yml
@@ -1,19 +1,17 @@
-app: example_app
-
# bomboo stack
-# dynos:
-# 900: 2
-# 2200: 1
-
-# workers:
-# 900: 1
-# 2200: 0
+# example_app:
+# dynos:
+# 900: 2
+# 2200: 1
+# workers:
+# 900: 1
+# 2200: 0
# cedar stack
-web:
- 900: 2
- 2200: 1
-
-worker:
- 900: 1
- 2200: 0
+example_app:
+ web:
+ 900: 2
+ 2200: 1
+ worker:
+ 900: 1
+ 2200: 0
View
20 lib/heroku_scale_scheduler/client.rb
@@ -7,15 +7,17 @@ def run(type = :ps)
config = HerokuScaleScheduler::Config.read_config
run_at = (Time.now.strftime('%H%M').to_i / 10) * 10
- if type != :ps && qty = config[type.to_s][run_at]
- case type
- when :dynos then client.set_dynos(config['app'], qty)
- when :workers then client.set_workers(config['app'], qty)
- end
- else
- config.keys.each do |ps|
- if qty = config[ps][run_at]
- client.ps_scale(config['app'], :type => ps, :qty => qty)
+ config.keys.each do |app|
+ if type != :ps && qty = config[app][type.to_s][run_at]
+ case type
+ when :dynos then client.set_dynos(app, qty)
+ when :workers then client.set_workers(app, qty)
+ end
+ else
+ config[app].keys.each do |ps|
+ if qty = config[app][ps][run_at]
+ client.ps_scale(app, :type => ps, :qty => qty)
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.