Skip to content

Commit b53c3c1

Browse files
authored
Merge pull request #88 from dt3310321/s3
S3
2 parents 1212600 + 288372e commit b53c3c1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

qcloud_cos/cos_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2492,9 +2492,11 @@ def upload_file_from_buffer(self, Bucket, Key, Body, MaxBufferSize=100, PartSize
24922492

24932493
lst = list() # 记录分块信息
24942494
MAXQueue = MaxBufferSize//PartSize
2495+
if MAXQueue == 0:
2496+
MAXQueue = 1
24952497
pool = SimpleThreadPool(MAXThread, MAXQueue)
24962498
while True:
2497-
if data == "":
2499+
if not data:
24982500
break
24992501
pool.add_task(self._upload_part_from_buffer, Bucket, Key, data, part_num, uploadid, lst)
25002502
part_num += 1

0 commit comments

Comments
 (0)