zombocom/rack-timeout

Conditional Timeouts

ankane opened this issue · 1 comments

Hey, since #110 was just closed, I added conditional timeouts to Slowpoke. You can set the service timeout with:

config.slowpoke.timeout = lambda do |env|
  request = Rack::Request.new(env)
  request.path.start_with?("/admin") ? 15 : 5
end

Noted. I see you're making a new middleware object for each timeout value, which certainly isn't ideal. But, at least there's a footgun available to footgunners. 😂