perf(video-studio): ⚡ Enable parallel uploads for bulk photo processing in video studio
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
cf4e55e89d
commit
044cc918e0
1 changed files with 3 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue