async-http-client
async-http-client copied to clipboard
HTTPClient timeout overrides timeout set in `HTTPClient.execute(_:timeout:logger:)`
If I create a HTTPClient as follows
let httpClient = HTTPClient(
eventLoopGroup: MultiThreadedEventLoopGroup.singleton,
configuration: .init(timeout: Timeout(read: .seconds(90))
)
and then call
let response = httpClient(request, timeout: .minutes(10), logger: logger)
the timeout in the execute call is ignored if it is longer than HTTPClient timeout.
This is particularly frustrating as HTTPClient.shared sets the timeout to be 90 seconds
Yeah, that seems to be the wrong priority: we should prefer the more specific timeout, not the less specific one. Would you be open to providing a patch @adam-fowler?
If I get time.