在 Heroku 上生成 gem - “PGError:服务器意外关闭了连接”

发布于 2024-12-09 21:46:23 字数 923 浏览 1 评论 0原文

我在 Rails 3 应用程序中使用 Spawn gem - 它是 https://github.com 上的rails3-adapted fork /rfc2822/spawn

我的应用程序部署在heroku上,当我尝试生成时出现此失败:

 app[web.1]: ### ../controllers/messages_controller.rb:10:in `create_message': About to spawn
 app[web.1]: spawn> parent PID = 1
 app[web.1]: spawn> child PID = 49
 app[web.1]: ### ../controllers/messages_controller.rb:17:in `create_message': After spawn
 app[web.1]:   Task Load (1.2ms)  SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = 80 LIMIT 1
 app[web.1]: PGError: server closed the connection unexpectedly
 app[web.1]:    This probably means the server terminated abnormally
 app[web.1]:    before or while processing the request.

我的 config/database.yml 中有此选项,遵循生成文档:

reconnect: true

您认为它与此有关吗?

有点不知所措......在我调查之前,有人知道是什么原因造成的吗? 干杯,最大

I'm using the Spawn gem in a rails 3 app - it's the rails3-adapted fork at https://github.com/rfc2822/spawn

My app is deployed on heroku, and when i tried to spawn i get this failure:

 app[web.1]: ### ../controllers/messages_controller.rb:10:in `create_message': About to spawn
 app[web.1]: spawn> parent PID = 1
 app[web.1]: spawn> child PID = 49
 app[web.1]: ### ../controllers/messages_controller.rb:17:in `create_message': After spawn
 app[web.1]:   Task Load (1.2ms)  SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = 80 LIMIT 1
 app[web.1]: PGError: server closed the connection unexpectedly
 app[web.1]:    This probably means the server terminated abnormally
 app[web.1]:    before or while processing the request.

I have this option in my config/database.yml, following the recommendation of the spawn documentation:

reconnect: true

Is it connected to this do you think?

Bit at a loss with this... before i go investigating, does anyone know what's causing this?
cheers, max

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

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

发布评论

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

评论(1

暮色兮凉城 2024-12-16 21:46:23

我最终使用了 Girl_friday gem,这是一个简单的分叉队列系统。这对我来说非常有效。

I ended up using the girl_friday gem instead, which is a simple forked-queue system. It worked great for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文