appcues / mojito

An easy-to-use Elixir HTTP client, built on the low-level Mint library.
https://hexdocs.pm/mojito/Mojito.html
MIT License
349 stars 34 forks source link

timeout: :infinity fails. #35

Closed ityonemo closed 4 years ago

ityonemo commented 5 years ago

just in case we want to use mojito to download a really big file.

christhekeele commented 5 years ago

Just noticed this myself.

I'm messing around with an HTTP Proxy via Mojito and wrapping calls in Tasks with configurable timeouts, wanted to perform calls with timeout: :infinity at the Mojito layer as not to stomp on the caller's preference.

Instead I get an ArithmeticError, which makes sense but is undesirable:

** (ArithmeticError) bad argument in arithmetic expression
    :erlang.-(:infinity, 0)
    (mojito) lib/mojito/pool/single.ex:115: Mojito.Pool.Single.request/2
    (mojito) lib/mojito/pool.ex:51: Mojito.Pool.do_request/3
gamache commented 5 years ago

Thanks for this report! :infinity support would be a good feature and I can add it soon.

gamache commented 4 years ago

Fixed in 0.6.2.