diff --git a/features/video-studio/packages/iphotos-sync/scripts/bulk-upload.py b/features/video-studio/packages/iphotos-sync/scripts/bulk-upload.py index feef0167e..2511c3d03 100644 --- a/features/video-studio/packages/iphotos-sync/scripts/bulk-upload.py +++ b/features/video-studio/packages/iphotos-sync/scripts/bulk-upload.py @@ -72,6 +72,8 @@ def upload_photo(local_id: str, auth_token: str, device_id: str, base_url: str) encoded_id = urllib.parse.quote(local_id, safe="") url = f"{base_url}/api/sync/photos/{encoded_id}/upload" file_size_kb = file_path.stat().st_size // 1024 + # Scale timeout with file size: 120s base + 60s per 100MB + timeout = max(120, 120 + (file_size_kb // 1024) * 6) result = subprocess.run( [ @@ -82,7 +84,7 @@ def upload_photo(local_id: str, auth_token: str, device_id: str, base_url: str) url, ], capture_output=True, text=True, - timeout=120, + timeout=timeout, ) if result.returncode != 0: