ruby-on-rails-3 - Heroku Cedar : How to scale WEB dynos based on time of day

标签 ruby-on-rails-3 heroku automation

我希望我的 Rails 3.1 应用程序在早上 8 点扩展到 1 个 web dyno,然后在下午 5 点缩小到 0 个 web dyno。

但是,我不想注册付费服务,而且我不能指望我的家用电脑连接到互联网。

Heroku Scheduler 似乎应该让这变得微不足道。任何快速的解决方案或链接?

最佳答案

作为@Ren 答案的更新,Heroku 的 Platform API gem让这很容易。

heroku = PlatformAPI.connect_oauth(<HEROKU PLATFORM API KEY>)
heroku.formation.batch_update(<HEROKU APP NAME>, {"updates" => 
  [{"process" => <PROCESS NAME>, 
  "quantity" => <QUANTITY AS INTEGER>, 
  "size" => <DYNO SIZE>}]
})

关于ruby-on-rails-3 - Heroku Cedar : How to scale WEB dynos based on time of day,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9186655/

相关文章:

ruby-on-rails - ActiveRecord::StatementInvalid: PG::Error: ERROR: cannot execute UPDATE in a read-only transaction 错误在 Heroku

用于编码标准的 JavaScript 工具

ruby-on-rails - ruby rails : undefined method for self action in model?

ruby-on-rails - Post.create 方法参数数量不正确(3 为 2)

ruby - 需要多对多和 habtm-checkboxes 帮助!

automation - 从 Picasa 导出面孔

deployment - 我的应用程序多次安装 - 我该如何处理

ruby-on-rails - Rails View 编码问题

json - 无法使用 Firebase 和 ElasticSearch(使用 Flashlight)进行正确的路径监控或查询

ruby-on-rails - 当 config.assets.initialize_on_precompile 为 false 时设置常量