设置rails请求超时(执行过期)
应该是一个简单的问题,但谷歌没有帮助:找不到一种方法让 Rails 在请求过期之前等待更长时间
ActionView::Template::Error(执行已过期)
=> Booting Thin
=> Rails 3.2.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Should be an easy one but google isn't helping: can't find a way to get rails to wait longer before a request expires
ActionView::Template::Error (execution expired)
=> Booting Thin
=> Rails 3.2.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,
gem list
查看您的rack_timeout 版本。如果您使用 rack_timeout <= 0.4,则使用
如果您使用 rack_timeout >= 0.5,则使用以下环境变量。
在rails中,您可以在.env文件中加载环境变量:
在config/environments/development.rb(或其他)中执行:
然后,在rails项目的根目录中,您的.env将如下所示:
First,
gem list
to see your rack_timeout version.If you're using rack_timeout <= 0.4 then use
If you're using rack_timeout >= 0.5 then use the following environment variables.
In rails, you can load environment variables in a .env file:
In your config/environments/development.rb (or other) do:
Then, in the root of your rails project, your .env will look like:
如果您使用
gem“rack-timeout”
然后在 config/initializers/timeout.rb 文件中更改 Rack::Timeout.timeout = 30 # 秒或更多。
使用此链接了解更多详细信息。
If you are using
gem "rack-timeout"
Then change the
Rack::Timeout.timeout = 30 # seconds
or more inside theconfig/initializers/timeout.rb
file.Use this link for more details.