File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -941,18 +941,18 @@ def _upload_single_part(
941941
942942 # Calculate timeout based on part size
943943 part_size_mb = len (chunk_data ) / (1024 * 1024 )
944- # Timeout scaling for large parts (5MB to 1GB+)
945- # Formula: 3min base + 10s per MB
946- base_timeout = 180 # 3 minutes base
947- scaling_factor = 10 # 10 seconds per 1MB
948- read_timeout = base_timeout + part_size_mb * scaling_factor
949- connect_timeout = 30
944+ # Timeout scaling for large parts
945+ # Formula: 20min base + 30s per MB to handle very large parts
946+ # This ensures adequate timeout even with slow connections
947+ base_timeout = 1200 # 20 minutes base
948+ scaling_factor = 30 # 30 seconds per 1MB
949+ total_timeout = base_timeout + part_size_mb * scaling_factor
950950
951951 upload_resp = session .put (
952952 upload_url ,
953953 data = chunk_data ,
954954 headers = headers ,
955- timeout = ( connect_timeout , read_timeout ) ,
955+ timeout = total_timeout ,
956956 )
957957
958958 if upload_resp .status_code == 200 :
You can’t perform that action at this time.
0 commit comments