From eb525cc34149affb45ba7048d9ad960aaa9bd990 Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 12 Mar 2025 12:15:01 -0400 Subject: [PATCH] Req backend is now upstreamed --- config/runtime.exs | 2 +- lib/philomena_media/req.ex | 31 ------------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 lib/philomena_media/req.ex diff --git a/config/runtime.exs b/config/runtime.exs index e5c35a87..09436250 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -88,7 +88,7 @@ config :philomena, :s3_secondary_options, config :philomena, :s3_secondary_bucket, System.get_env("ALT_S3_BUCKET") -config :ex_aws, http_client: PhilomenaMedia.Req +config :ex_aws, http_client: ExAws.Request.Req config :ex_aws, :retries, max_attempts: 20, diff --git a/lib/philomena_media/req.ex b/lib/philomena_media/req.ex deleted file mode 100644 index ff92d949..00000000 --- a/lib/philomena_media/req.ex +++ /dev/null @@ -1,31 +0,0 @@ -defmodule PhilomenaMedia.Req do - @behaviour ExAws.Request.HttpClient - - @moduledoc """ - Configuration for `m:Req`. - - Options can be set for `m:Req` with the following config: - - config :philomena, :req_opts, - receive_timeout: 30_000 - - The default config handles setting the above. - """ - - @default_opts [receive_timeout: 30_000] - - @impl true - def request(method, url, body \\ "", headers \\ [], http_opts \\ []) do - [method: method, url: url, body: body, headers: headers, decode_body: false] - |> Keyword.merge(Application.get_env(:philomena, :req_opts, @default_opts)) - |> Keyword.merge(http_opts) - |> Req.request() - |> case do - {:ok, %{status: status, headers: headers, body: body}} -> - {:ok, %{status_code: status, headers: headers, body: body}} - - {:error, reason} -> - {:error, %{reason: reason}} - end - end -end