Skip to content

Commit cb7fdee

Browse files
author
Tatjana Damnjanović
committed
Merge branch 'multipart-upload' into release-candidate-2.32.1rc1
2 parents bfa5744 + 98a9a92 commit cb7fdee

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

solvebio/resource/object.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)