Closed Matte22 closed 4 months ago
The PR should be updated to change the option name to responseTimeout
and set the corresponding timeout property in the request options. Discussion below:
The got
library supports timeouts for various events during a request/response.
We set a timeout primarily to detect an apiOffline
condition. We've been setting the request
timeout which starts when the request is initiated and ends when the response's end event fires. The response's end event fires when the entire response body has been received. For large bodies sent across slow networks this may trigger false positives of the offline condition.
We should instead set the response
timeout which starts when the request has been fully sent and ends when the HTTP headers are received, which happens prior to receiving the response body. This will more accurately reflect the API's online status with less chance of a false positive.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Resolves: #120 This PR enhances our API request timeout to be configurable. It Also increases the default request timeout to 20 seconds.