Conversation
| assert_raises(Rack::Timeout::RequestTimeoutError) do | ||
| get "/sleep" | ||
| end | ||
| end |
There was a problem hiding this comment.
Would also be nice to have tests that do something different based on the env parameter to #call
|
Noting for description update: Our goal is to have different timeouts for different paths. E.g. Rails.application.config.middleware.insert_before(
Rack::Runtime,
Rack::Timeout,
service_timeout: ->(env) {
REQUEST_PATH_TIMEOUTS[env['REQUEST_PATH']] || ENV.fetch('WEB_TIMEOUT', 10).to_i
}
) |
|
FYI interest to add something like this has been cold in the past: #174 Probably worth maintaining and publishing your own fork of this gem if you need this. Feel free to link it in the relevant issues if you do it. |
Thanks for the heads up! #110 looks pretty similar in concept with the use of a Proc. We've got an alternative approach already in use but wanted to contribute something back if we could. |
|
Closing the PR as per the above discussion. |
Before
After