File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -951,18 +951,18 @@ def _upload_single_part(
951951
952952 # Calculate timeout based on part size
953953 part_size_mb = len (chunk_data ) / (1024 * 1024 )
954- # Timeout scaling for large parts (5MB to 1GB+)
955- # Formula: 3min base + 10s per MB
956- base_timeout = 180 # 3 minutes base
957- scaling_factor = 10 # 10 seconds per 1MB
958- read_timeout = base_timeout + part_size_mb * scaling_factor
959- connect_timeout = 30
954+ # Timeout scaling for large parts
955+ # Formula: 20min base + 30s per MB to handle very large parts
956+ # This ensures adequate timeout even with slow connections
957+ base_timeout = 1200 # 20 minutes base
958+ scaling_factor = 30 # 30 seconds per 1MB
959+ total_timeout = base_timeout + part_size_mb * scaling_factor
960960
961961 upload_resp = session .put (
962962 upload_url ,
963963 data = chunk_data ,
964964 headers = headers ,
965- timeout = ( connect_timeout , read_timeout ) ,
965+ timeout = total_timeout ,
966966 )
967967
968968 if upload_resp .status_code == 200 :
You can’t perform that action at this time.
0 commit comments