Catch more errors, adjust retries

This commit is contained in:
byte[] 2022-11-05 11:39:30 -04:00
parent a7ffde8f89
commit 1ce934b75a
2 changed files with 9 additions and 4 deletions

View file

@ -95,6 +95,11 @@ config :ex_aws, :hackney_opts,
use_default_pool: false, use_default_pool: false,
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 if config_env() != :test do
# Database config # Database config
config :philomena, Philomena.Repo, config :philomena, Philomena.Repo,

View file

@ -75,8 +75,8 @@ defmodule Philomena.Objects do
file_path = Briefly.create!() file_path = Briefly.create!()
download_file(source_key, file_path) download_file(source_key, file_path)
upload(dest_key, file_path) upload(dest_key, file_path)
rescue catch
_ -> Logger.warn("Failed to copy #{source_key} -> #{dest_key}") _kind, _value -> Logger.warn("Failed to copy #{source_key} -> #{dest_key}")
end end
end end
@ -107,8 +107,8 @@ defmodule Philomena.Objects do
try do try do
wrapped.(opts) wrapped.(opts)
:ok :ok
rescue catch
_ -> :error _kind, _value -> :error
end end
end end