diff --git a/config/runtime.exs b/config/runtime.exs index 2e211f30..883f1345 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -95,6 +95,11 @@ config :ex_aws, :hackney_opts, use_default_pool: false, pool: false +config :ex_aws, :retries, + max_attempts: 20, + base_backoff_in_ms: 10, + max_backoff_in_ms: 10_000 + if config_env() != :test do # Database config config :philomena, Philomena.Repo, diff --git a/lib/philomena/objects.ex b/lib/philomena/objects.ex index cfd492d8..8c18f039 100644 --- a/lib/philomena/objects.ex +++ b/lib/philomena/objects.ex @@ -75,8 +75,8 @@ defmodule Philomena.Objects do file_path = Briefly.create!() download_file(source_key, file_path) upload(dest_key, file_path) - rescue - _ -> Logger.warn("Failed to copy #{source_key} -> #{dest_key}") + catch + _kind, _value -> Logger.warn("Failed to copy #{source_key} -> #{dest_key}") end end @@ -107,8 +107,8 @@ defmodule Philomena.Objects do try do wrapped.(opts) :ok - rescue - _ -> :error + catch + _kind, _value -> :error end end