我正在使用 byebug 调试我的 Rails 应用程序。调试器停止但在一段时间后自动继续并给出:
[5188] !终止超时 worker :5378
- Worker 0 (pid: 5959) 已启动,阶段:0
有时它也会使终端挂起。 请帮忙!
最佳答案
我可以通过更改 config/puma.rb 中的 worker_timeout 来解决这个问题。 似乎问题已经在使用这些行的新 Rails 6.1 项目中得到解决:
# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
#
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
默认为 90 秒。
puma 文档说:
Verifies that all workers have checked in to the master process within the given timeout. If not the worker process will be restarted. This is not a request timeout, it is to protect against a hung or dead process. Setting this value will not protect against slow requests.
https://www.rubydoc.info/gems/puma/Puma%2FDSL:worker_timeout
关于ruby-on-rails - Rails 调试器在一段时间后自动退出,Ubuntu 终端选项卡挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51292576/