Skip to content

Commit

Permalink
Fix upload file Processing callback
Browse files Browse the repository at this point in the history
  • Loading branch information
terricain committed May 27, 2024
1 parent e654bd6 commit 4ad23e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aioboto3/s3/inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ async def upload_fileobj(
initial_data = Fileobj.read(Config.multipart_threshold)
if inspect.isawaitable(initial_data):
initial_data = await initial_data
if Processing:
initial_data = Processing(initial_data)

if len(initial_data) < Config.multipart_threshold:
# Do put_object
Expand All @@ -360,6 +362,8 @@ async def upload_fileobj(
Body=initial_data,
**kwargs
)
if Callback:
Callback(len(initial_data))
return

# File bigger than threshold, start multipart upload
Expand Down

0 comments on commit 4ad23e3

Please sign in to comment.