1234567891011121314151617181920 |
- def upload_virtual_file_part(self, upload_id, index_list, part_number_list):
- """
- 多线程上传虚拟文件分片
- :param upload_id: 分片上传的upload id
- :param index_list: 所有分片的
- :param part_number_list:
- :return:
- """
- part_number = 1
- total = len(index_list)
- part_data_body = CHUNK_SIZE * "a"
- with futures.ThreadPoolExecutor(max_workers=MAX_THREADS) as pool:
- for part_start_index in index_list:
- if part_number not in part_number_list:
- pool.submit(self.upload_virtual_file_thread, upload_id, part_number, part_data_body, total)
- part_number += 1
- print ("所有分片文件已上传, 文件名: {}, 文件大小:{}".format(MULTIPART_UPLOAD_FILE_NAME, MULTIPART_UPLOAD_FILE_SIZE))
- return part_number - 1
|