forked from mirrors/akkoma
c17d83cd73
- fix for gun worker termination in some circumstances - pool for http clients (ex_aws, tzdata) - default pool timeouts for gun - gun retries on gun_down messages - s3 upload timeout if streaming enabled
24 lines
669 B
Elixir
24 lines
669 B
Elixir
# Pleroma: A lightweight social networking server
|
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
defmodule Pleroma.HTTP.ExAws do
|
|
@moduledoc false
|
|
|
|
@behaviour ExAws.Request.HttpClient
|
|
|
|
alias Pleroma.HTTP
|
|
|
|
@impl true
|
|
def request(method, url, body \\ "", headers \\ [], http_opts \\ []) do
|
|
http_opts = Keyword.put(http_opts, :adapter, pool: :upload)
|
|
|
|
case HTTP.request(method, url, body, headers, http_opts) do
|
|
{:ok, env} ->
|
|
{:ok, %{status_code: env.status, headers: env.headers, body: env.body}}
|
|
|
|
{:error, reason} ->
|
|
{:error, %{reason: reason}}
|
|
end
|
|
end
|
|
end
|