gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 00:11:52 25 4
gpt4 key购买 nike

我希望我的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com