diff --git a/app/config/config.exs b/app/config/config.exs index c890ea15a..9194c04a7 100644 --- a/app/config/config.exs +++ b/app/config/config.exs @@ -75,6 +75,11 @@ config :authoritex, config :httpoison_retry, wait: 50 +config :ex_aws, :hackney_opts, + pool: :default, + max_connections: 500, + checkout_timeout: 30_000 + config :meadow, :extra_mime_types, %{ "aif" => "audio/x-aiff", "aifc" => "audio/x-aiff", diff --git a/app/lib/meadow/utils/aws/multipart_copy.ex b/app/lib/meadow/utils/aws/multipart_copy.ex index 1e46ae2a6..e88f750c5 100644 --- a/app/lib/meadow/utils/aws/multipart_copy.ex +++ b/app/lib/meadow/utils/aws/multipart_copy.ex @@ -51,10 +51,18 @@ defmodule Meadow.Utils.AWS.MultipartCopy do other -> other end + + case ExAws.S3.head_object(dest_bucket, dest_object) |> AWS.request() do + {:ok, anything} -> {:ok, anything} + other -> + Logger.error("Multipart copy failed: #{inspect(other)}") + {:error, "Multipart copy failed: #{inspect(other)}"} + end + end defp copy_s3_object(%__MODULE__{content_length: length} = op) when length > @threshold do - Logger.debug("File size #{length} > #{@threshold}; using MultipartUpload") + Logger.info("File size #{length} > #{@threshold}; using MultipartUpload") op |> initiate_upload() @@ -63,7 +71,7 @@ defmodule Meadow.Utils.AWS.MultipartCopy do end defp copy_s3_object(%__MODULE__{content_length: length} = op) do - Logger.debug("File size #{length} <= #{@threshold}; using CopyObject") + Logger.info("File size #{length} <= #{@threshold}; using CopyObject") ExAws.S3.put_object_copy( op.dest_bucket, @@ -116,19 +124,19 @@ defmodule Meadow.Utils.AWS.MultipartCopy do defp upload_chunks({:error, payload}), do: {:error, payload} defp complete_upload({:error, %__MODULE__{} = op}) do - Logger.debug("Error encountered. Aborting multipart upload.") + Logger.error("Error encountered. Aborting multipart upload.") ExAws.S3.abort_multipart_upload(op.dest_bucket, op.dest_object, op.upload_id) |> AWS.request() end defp complete_upload({:error, other}) do - Logger.debug("Error encountered. #{inspect(other)}") + Logger.error("Error encountered. #{inspect(other)}") {:error, parse_error(other)} end defp complete_upload({parts, %__MODULE__{} = op}) do - Logger.debug("Completing multipart upload.") + Logger.info("Completing multipart upload.") ExAws.S3.complete_multipart_upload(op.dest_bucket, op.dest_object, op.upload_id, parts) |> Map.put(:parser, &parse_complete_result/1) diff --git a/app/mix.exs b/app/mix.exs index 938e003e9..e2a75f019 100644 --- a/app/mix.exs +++ b/app/mix.exs @@ -1,7 +1,7 @@ defmodule Meadow.MixProject do use Mix.Project - @app_version "9.6.0" + @app_version "9.6.1" def project do [