Recommended way to set the timeout
mintuhouse opened this issue · 1 comments
mintuhouse commented
Documentation still used depreciated class methods to set the service_timeout value in rails apps.
Wanted to confirm if below code would be the recommended way to set it today?
# Gemfile
gem "rack-timeout", require:"rack/timeout/base"
# config/initializers/rack_timeout.rb
if defined?(ActionDispatch::RequestId)
app.config.middleware.insert_after(ActionDispatch::RequestId, Rack::Timeout, service_timeout: 5)
else
app.config.middleware.insert_before(Rack::Runtime, Rack::Timeout, service_timeout: 5)
end
It would be nice to have a simpler configuration option
bobintornado commented
yes i'd like to know this also.
and is this gem still alive?