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.3.5 instead of httpoison, especially in a livebook setting for its simplicity.
1
Popular in Questions
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
Hi there,
I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
I have an umbrella app.
Some of the apps inside depend on other apps in the umbrella, unsurprisingly.
I'm writing a test for one of t...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
What is most correct way to open, read and parse JSON file with poison?
For example if we have example.json file in root of some projec...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors:
[WARN] - (starship::utils): Executing command ...
New
Other popular topics
can someone please explain to me how Enum.reduce works with maps
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
Hi,
I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
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







