Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new AWS_S3_CLIENT_CONFIG parameter #378

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions stade/core/storage_backends.py

This file was deleted.

12 changes: 10 additions & 2 deletions stade/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from pathlib import Path

from botocore.config import Config
from composed_configuration import (
ComposedConfiguration,
ConfigMixin,
Expand Down Expand Up @@ -77,13 +78,11 @@ class TestingConfiguration(StadeMixin, TestingBaseConfiguration):


class ProductionConfiguration(StadeMixin, ProductionBaseConfiguration):
DEFAULT_FILE_STORAGE = 'stade.core.storage_backends.TimeoutS3Boto3Storage'
# TODO: What about this?
EMAIL_TIMEOUT = 10


class HerokuProductionConfiguration(StadeMixin, HerokuProductionBaseConfiguration):
DEFAULT_FILE_STORAGE = 'stade.core.storage_backends.TimeoutS3Boto3Storage'
# TODO: What about this?
EMAIL_TIMEOUT = 10
CACHES = {
Expand All @@ -94,3 +93,12 @@ class HerokuProductionConfiguration(StadeMixin, HerokuProductionBaseConfiguratio
}

SENTRY_TRACES_SAMPLE_RATE = 0.01 # sample 1% of requests for performance monitoring

@staticmethod
def mutate_configuration(configuration: ComposedConfiguration) -> None:
configuration.AWS_S3_CLIENT_CONFIG = Config(
connect_timeout=3,
read_timeout=10,
retries={'max_attempts': 5},
signature_version=configuration.AWS_S3_SIGNATURE_VERSION,
)
Loading