From c304ff02d2915b1e5ae267b783a119c5f3538e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Garc=C3=ADa=20Isa=C3=ADa?= Date: Wed, 31 Aug 2022 20:05:51 -0300 Subject: [PATCH] Allow to disable HTTP requests timeouts (#2146) 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]: https://github.com/elixir-ecto/ecto/issues/2833#issuecomment-440400022 [1]: https://elixirforum.com/t/request-to-phoenix-server-times-out-after-60-seconds/20851/6 --- config/config.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.exs b/config/config.exs index 0c6c5f948..b0c7fdbd2 100644 --- a/config/config.exs +++ b/config/config.exs @@ -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