这应该很容易,但谷歌没有帮助:无法找到让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发布于 2018-11-14 14:20:12
首先,使用gem list查看您的rack_timeout版本。
如果使用的是rack_timeout <= 0.4,那么请使用
Rack::Timeout.timeout = 30 # seconds inside the config/initializers/timeout.rb如果使用的是rack_timeout >= 0.5,则使用以下环境变量。
service_timeout: 15 # RACK_TIMEOUT_SERVICE_TIMEOUT
wait_timeout: 30 # RACK_TIMEOUT_WAIT_TIMEOUT
wait_overtime: 60 # RACK_TIMEOUT_WAIT_OVERTIME
service_past_wait: false # RACK_TIMEOUT_SERVICE_PAST_WAIT在rails中,可以在.env文件中加载环境变量:
gem 'dotenv-rails'在您的配置/环境/Development.rb(或其他)中执行以下操作:
Dotenv::Railtie.load然后,在rails项目的根目录中,您的.env如下所示:
RACK_TIMEOUT_SERVICE_TIMEOUT=15
RACK_TIMEOUT_WAIT_TIMEOUT=30
RACK_TIMEOUT_WAIT_OVERTIME=60
RACK_TIMEOUT_SERVICE_PAST_WAIT=false发布于 2013-04-16 09:03:54
如果您正在使用gem "rack-timeout",那么在config/initializers/timeout.rb文件中更改Rack::Timeout.timeout = 30 # seconds或更多内容。有关更多细节,请使用此链接。
https://stackoverflow.com/questions/2583166
复制相似问题