Skip to content

Commit

Permalink
Merge pull request #378 from ImageMarkup/fix-config-inheritance
Browse files Browse the repository at this point in the history
Use new AWS_S3_CLIENT_CONFIG parameter
  • Loading branch information
danlamanna authored Jul 18, 2024
2 parents 4c7149d + e149a9d commit 3fa8be5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
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,
)

0 comments on commit 3fa8be5

Please sign in to comment.