Skip to content

Commit a061e56

Browse files
committed
chore: add comment on zero size limit; reduce chunk size
Signed-off-by: Ben Selwyn-Smith <[email protected]>
1 parent a38cf1a commit a061e56

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/macaron/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def stream_file_with_size_limit(
339339
size_limit: int
340340
The size limit in bytes of the downloaded file.
341341
A download will terminate if it reaches beyond this amount.
342+
The default value of zero disables the limit.
342343
343344
Returns
344345
-------
@@ -356,7 +357,7 @@ def stream_file_with_size_limit(
356357
return False
357358

358359
data_processed = 0
359-
for chunk in response.iter_content(chunk_size=1048576):
360+
for chunk in response.iter_content(chunk_size=512):
360361
if data_processed >= size_limit > 0:
361362
response.close()
362363
logger.warning(

0 commit comments

Comments
 (0)