Azure / Azure/azure-storage-python

Large File Upload Max_Conncurrenct

Đang mở
#698 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
343
Fork
243
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi,

I am using the following code from one of the other posts in the the azure sdk and i keep seeing there is a Max_Concurrency or Max_Connections. I was wondering if it can be used in the code to allow more chunk uploads at the same time.

`import os
from azure.storage.blob import BlobServiceClient, BlobClient
from azure.storage.blob import ContentSettings, ContainerClient,BlobBlock
import uuid

# Instantiate a new BlobServiceClient using a connection string
blob_service_client = BlobServiceClient.from_connection_string("Conn String")
# Instantiate a new ContainerClient
container_client = blob_service_client.get_container_client('cctvvideo')
blob_client = container_client.get_blob_client(r"file.mp4")
# upload data
block_list=[]
chunk_size=4000000
with open(r'C:\Temp\file.mp4','rb') as f:

while True:
read_data = f.read(chunk_size)
if not read_data:
break # done
blk_id = str(uuid.uuid4())
blob_client.stage_block(block_id=blk_id,data=read_data)
block_list.append(BlobBlock(block_id=blk_id))
print (uuid.uuid4())

blob_client.commit_block_list(block_list)`

Thanks in advance.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.