mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-11 06:54:48 +02:00
Review feedback: retries settings
This commit is contained in:
parent
459e753edd
commit
65fd8d3893
2 changed files with 6 additions and 1 deletions
|
@ -20,6 +20,9 @@ import environs
|
|||
from base64 import b64decode
|
||||
from cfenv import AppEnv # type: ignore
|
||||
from pathlib import Path
|
||||
from typing import Final
|
||||
|
||||
from botocore.config import Config
|
||||
|
||||
# # # ###
|
||||
# Setup code goes here #
|
||||
|
@ -221,9 +224,10 @@ AWS_ACCESS_KEY_ID = secret_aws_ses_key_id
|
|||
AWS_SECRET_ACCESS_KEY = secret_aws_ses_key
|
||||
AWS_REGION = "us-gov-west-1"
|
||||
# https://boto3.amazonaws.com/v1/documentation/api/latest/guide/retries.html#standard-retry-mode
|
||||
AWS_RETRY_MODE = "standard"
|
||||
AWS_RETRY_MODE: Final = "standard"
|
||||
# base 2 exponential backoff with max of 20 seconds:
|
||||
AWS_MAX_ATTEMPTS = 3
|
||||
BOTO_CONFIG = Config(retries={"mode": AWS_RETRY_MODE, "max_attempts": AWS_MAX_ATTEMPTS})
|
||||
|
||||
# email address to use for various automated correspondence
|
||||
# TODO: pick something sensible here
|
||||
|
|
|
@ -29,6 +29,7 @@ def send_templated_email(template_name: str, to_address: str, context={}):
|
|||
region_name=settings.AWS_REGION,
|
||||
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
|
||||
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
|
||||
config=settings.BOTO_CONFIG,
|
||||
)
|
||||
except Exception as exc:
|
||||
raise EmailSendingError("Could not access the SES client.") from exc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue