Skip to content

Commit

Permalink
Add gevent / boto3 threads warning
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgigante authored Aug 12, 2024
1 parent b239095 commit 7941381
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions django_s3_storage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import os
import posixpath
import shutil
import sys
import warnings
from contextlib import closing
from datetime import timezone
from functools import partial, wraps
Expand Down Expand Up @@ -198,6 +200,11 @@ def _setup(self):
raise ImproperlyConfigured(
f"Setting AWS_S3_BUCKET_NAME{self.s3_settings_suffix} is required."
)
if "gevent" in sys.modules and self.settings.AWS_S3_USE_THREADS:
warnings.warn(
"boto3 and gevent interaction likely. "
"Please set AWS_S3_USE_THREADS to False."
)
# Create a thread-local connection manager.
self._connections = _Local(self)
# Set transfer config for S3 operations
Expand Down

0 comments on commit 7941381

Please sign in to comment.