Module: NetHTTPPatch
- Defined in:
- lib/freedom_patches/net_http.rb
Constant Summary collapse
- OPEN_TIMEOUT =
5
- READ_TIMEOUT =
10
- WRITE_TIMEOUT =
5
- MAX_RETIRES =
By default Net::HTTP will retry 1 time on idempotent requests but we can’t afford that while processing a request so setting it to 0
0
Instance Method Summary collapse
Instance Method Details
#initialize(*args, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/freedom_patches/net_http.rb', line 12 def initialize(*args, &block) super(*args, &block) ## START PATCH if Thread.current[Middleware::ProcessingRequest::PROCESSING_REQUEST_THREAD_KEY] self.open_timeout = OPEN_TIMEOUT self.read_timeout = READ_TIMEOUT self.write_timeout = WRITE_TIMEOUT self.max_retries = 0 end ## END PATCH end |