我可以发出“heroku restart”吗?来自 Heroku 上运行的应用程序内的命令?

发布于 2024-12-15 09:56:32 字数 88 浏览 3 评论 0原文

我的(Sinatra)应用程序间歇性地进入不良状态,我只能通过重新启动 Heroku dyno 来修复。我当然想解决根本问题,但同时,我希望用户不要感到如此不便。

My (Sinatra) app intermittently goes into a bad state that I have only been able to fix by restarting the Heroku dyno. Of course I would like to fix the fundamental problem, but meanwhile, I'd like user not to be so inconvenienced.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

碍人泪离人颜 2024-12-22 09:56:32

国家到底有多“糟糕”?如果应用程序仍在运行,您可能可以使用 Ruby 中的 system 命令来发出该命令。

但这似乎是个坏主意。相反,您可能想要做的(直到解决根本问题!)是让应用程序外部有一些东西来监视它。也许你可以设置一个 Nagios、God 或其他东西的实例......

How "bad" is the state? If the application is still running, you could probably use the system command in Ruby to issue the command.

But this seems like a bad idea. What you might want to do instead (until you fix the fundamental problem!) is have something external to the app monitoring it. Perhaps you can set up an instance of Nagios, God, or something...

轮廓§ 2024-12-22 09:56:32

以下作品。它不能在 Heroku“aspen”堆栈上工作,但可以在竹子 1.9.2 堆栈上工作。

require 'heroku'
~
~
heroku = Heroku::Client.new("YOUR EMAIL", "YOUR PASSWORD")
heroku.ps_restart("hacknews")

The following works. It was NOT working on the Heroku "aspen" stack, but it is on the bamboo 1.9.2 stack.

require 'heroku'
~
~
heroku = Heroku::Client.new("YOUR EMAIL", "YOUR PASSWORD")
heroku.ps_restart("hacknews")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文