baruh
Livebook timeout with httpoison
I have very simple livebook with setup like this
Mix.install([
{:httpoison, "~> 2.0.0"},
{:jason, "~> 1.4.0"}
])
and some code
url = "https://example.com/generate/image"
timeout = 60000
headers = [{"Content-Type", "application/json"}]
resp = HTTPoison.post!(url, payload, headers, timeout: timeout, recv_timout: timeout)
However, it seems like my requests timeout still after 5s instead of after 60s.
** (HTTPoison.Error) :timeout
(httpoison 2.0.0) lib/httpoison.ex:261: HTTPoison.request!/5
I suppose the problem is that I did not set the timeout for hackney.
Any ideas how I can do that?
NOTE: I am so new to the livebook coding, that I could not even find how to stop the session and start from the beginning.
Marked As Solved
jerdew
It sounds like you might be right. Perhaps this github issue helps? Timeout bigger than 5s does not work with hackney adapter · Issue #151 · elixir-tesla/tesla · GitHub
I also recommend trying Req — req v0.6.2 instead of httpoison, especially in a livebook setting for its simplicity.
1
Last Post!
baruh
Popular in Questions
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
Hi,
I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
Other popular topics
Hi!
In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir?
Searched the docs for ip address and the web, no good results.
Thanks!
New
I would like to know what is the best IDE for elixir development?
New
What is the idiomatic way of matching for not nil in Elixir?
E.g.,
First way:
defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Credo is smart enough to check for (something like) this:
assert length(the_list) == 0
with this response:
Checking if an enum is empt...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
Latest Livebook Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security










