Skip to content

Commit

Permalink
Merge pull request #840 from ImageMarkup/add-s3-retries
Browse files Browse the repository at this point in the history
Add retries for s3 requests
  • Loading branch information
danlamanna authored Feb 14, 2024
2 parents ebaa842 + 5dd6130 commit 2a50503
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions isic/core/storages/s3.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
from datetime import datetime, timedelta
from urllib.parse import urlencode

from botocore.config import Config
from django.utils.encoding import filepath_to_uri
from storages.backends.s3 import S3Storage
from storages.utils import clean_name


class CacheableCloudFrontStorage(S3Storage):
def __init__(self, **settings):
super().__init__(**settings)

self.config = self.config.merge(
Config(connect_timeout=5, read_timeout=10, retries={"max_attempts": 5})
)

@staticmethod
def next_expiration_time(now=None):
# returns a time > 6 days but <= 7.
Expand Down

0 comments on commit 2a50503

Please sign in to comment.