Skip to content

Commit

Permalink
Allow to disable HTTP requests timeouts (#2146)
Browse files Browse the repository at this point in the history
Since the upgrade of Ecto, it doesn't have the issue with timeouts (nor
pool timeouts) anymore, due to Ecto using a new queing system[0].

But we've also upgraded Cowboy, and now has a default 1-minute timeout for
HTTP requests[1]. So, in order for large downloads not to fail, that's the
timeout we have to remove.

[0]: elixir-ecto/ecto#2833 (comment)
[1]: https://elixirforum.com/t/request-to-phoenix-server-times-out-after-60-seconds/20851/6
  • Loading branch information
matiasgarciaisaia committed Oct 4, 2022
1 parent cdc4e9f commit c304ff0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ config :phoenix, :json_library, Poison
config :ask,
ecto_repos: [Ask.Repo]

if System.get_env("DISABLE_REPO_TIMEOUT") == "true" do
config :ask, Ask.Repo, timeout: :infinity
if System.get_env("DISABLE_TIMEOUTS") == "true" do
config :ask, AskWeb.Endpoint, http: [protocol_options: [idle_timeout: :infinity]]
end

# Configures the endpoint
Expand Down

0 comments on commit c304ff0

Please sign in to comment.