Skip to content

Commit

Permalink
Create a separate boto3 session for each file store thread
Browse files Browse the repository at this point in the history
  • Loading branch information
djmaze committed Sep 13, 2018
1 parent 503fd7b commit 05d9bf6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion s3_storage_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def store_file(self, path, file_info):
"""See StorageProvider.store_file"""

def _store_file():
boto3.resource('s3', **self.api_kwargs).Bucket(self.bucket).upload_file(
session = boto3.session.Session()
session.resource('s3', **self.api_kwargs).Bucket(self.bucket).upload_file(
Filename=os.path.join(self.cache_directory, path),
Key=path,
ExtraArgs={"StorageClass": self.storage_class},
Expand Down

0 comments on commit 05d9bf6

Please sign in to comment.