Skip to content

Commit 5338bad

Browse files
committed
Merge branch 'Roriz-patch-1'
2 parents c9de542 + 27d3bc9 commit 5338bad

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

CHANGELOG.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
django-s3-storage changelog
22
===========================
33

4+
0.13.11
5+
-------
6+
7+
- Added ``AWS_S3_CONNECT_TIMEOUT`` setting (@roriz).
8+
49
0.13.10
510
-------
611

README.rst

+6
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ Use the following settings to configure the S3 file storage. You must provide at
120120
# is used it must be disabled
121121
AWS_S3_USE_THREADS = True
122122
123+
# Max pool of connections for massive S3 interactions
124+
AWS_S3_MAX_POOL_CONNECTIONS = 10
125+
126+
# Time to raise timeout when submitting a new file
127+
AWS_S3_CONNECT_TIMEOUT = 60
128+
123129
**Important:** Several of these settings (noted above) will not affect existing files. To sync the new settings to
124130
existing files, run ``./manage.py s3_sync_meta django.core.files.storage.default_storage``.
125131

django_s3_storage/storage.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ def __init__(self, storage):
116116
self.s3_connection = self.session.client("s3", config=Config(
117117
s3={"addressing_style": storage.settings.AWS_S3_ADDRESSING_STYLE},
118118
signature_version=storage.settings.AWS_S3_SIGNATURE_VERSION,
119-
max_pool_connections=storage.settings.AWS_S3_MAX_POOL_CONNECTIONS
119+
max_pool_connections=storage.settings.AWS_S3_MAX_POOL_CONNECTIONS,
120+
connect_timeout=storage.settings.AWS_S3_CONNECT_TIMEOUT
120121
), **connection_kwargs)
121122

122123

@@ -152,7 +153,8 @@ class S3Storage(Storage):
152153
"AWS_S3_SIGNATURE_VERSION": "s3v4",
153154
"AWS_S3_FILE_OVERWRITE": False,
154155
"AWS_S3_USE_THREADS": True,
155-
"AWS_S3_MAX_POOL_CONNECTIONS": 10
156+
"AWS_S3_MAX_POOL_CONNECTIONS": 10,
157+
"AWS_S3_CONNECT_TIMEOUT": 60 # 60 seconds
156158
}
157159

158160
s3_settings_suffix = ""

0 commit comments

Comments
 (0)