Skip to content
Snippets Groups Projects
Commit 32600e7c authored by Erwan Rouchet's avatar Erwan Rouchet Committed by Bastien Abadie
Browse files

Add an option for maximum retries on all S3 requests

parent cdade876
No related branches found
No related tags found
1 merge request!2487Add an option for maximum retries on all S3 requests
......@@ -30,6 +30,10 @@ def get_s3_resource(
signature_version="s3v4",
s3={
"addressing_style": "auto" if endpoint else "virtual",
},
retries={
"mode": "standard",
"max_attempts": settings.AWS_MAX_RETRIES,
}
)
......
......@@ -209,6 +209,7 @@ def get_settings_parser(base_dir):
parser.add_option("cache", default={}, type=cache_validator)
s3_parser = add_s3_parser(parser, "s3")
s3_parser.add_option("max_retries", type=int, default=5)
s3_parser.add_option("thumbnails_bucket", type=str, default="thumbnails")
s3_parser.add_option("staging_bucket", type=str, default="staging")
s3_parser.add_option("export_bucket", type=str, default="export")
......
......@@ -528,6 +528,7 @@ AWS_ACCESS_KEY = conf["s3"]["access_key_id"]
AWS_SECRET_KEY = conf["s3"]["secret_access_key"]
AWS_ENDPOINT = conf["s3"]["endpoint"]
AWS_REGION = conf["s3"]["region"]
AWS_MAX_RETRIES = conf["s3"]["max_retries"]
PONOS_S3_LOGS_BUCKET = conf["s3"]["ponos_logs_bucket"]
PONOS_S3_ARTIFACTS_BUCKET = conf["s3"]["ponos_artifacts_bucket"]
......
......@@ -81,6 +81,7 @@ s3:
access_key_id: null
endpoint: null
export_bucket: export
max_retries: 5
ponos_artifacts_bucket: ponos-artifacts
ponos_logs_bucket: ponos-logs
region: null
......
......@@ -62,6 +62,7 @@ redis:
timeout: sauce
s3:
endpoint: null
max_retries: [1, 2]
ponos_artifacts_bucket: {}
ponos_logs_bucket: null
region: null
......
......@@ -40,6 +40,8 @@ redis:
port: "invalid literal for int() with base 10: 'over nine thousand'"
db: "invalid literal for int() with base 10: 'idk'"
timeout: "invalid literal for int() with base 10: 'sauce'"
s3:
max_retries: "int() argument must be a string, a bytes-like object or a real number, not 'list'"
session:
cookie_samesite: "'foo' is not a valid CookieSameSiteOption"
signup_default_group: "badly formed hexadecimal UUID string"
......
......@@ -98,6 +98,7 @@ s3:
access_key_id: abcd
endpoint: http://somewhere
export_bucket: exbort
max_retries: 99
ponos_artifacts_bucket: zstandardland
ponos_logs_bucket: plaintexttown
region: middle-earth-1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment