mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
Catch more errors, adjust retries
This commit is contained in:
parent
a7ffde8f89
commit
1ce934b75a
2 changed files with 9 additions and 4 deletions
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue