Skip to content

Commit

Permalink
Catch slower connections
Browse files Browse the repository at this point in the history
5 seconds worked here with a 4K image set, but slower connections would probably struggle.
  • Loading branch information
Audionut committed Sep 29, 2024
1 parent 6b6a2d3 commit cf81e4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2530,7 +2530,7 @@ def upload_screens(self, meta, screens, img_host_num, i, total_screens, custom_i

image_list = []
successfully_uploaded = set() # Track successfully uploaded images
initial_timeout = 5 # Set the initial timeout for backoff
initial_timeout = 10 # Set the initial timeout for backoff

if custom_img_list:
image_glob = custom_img_list
Expand All @@ -2550,8 +2550,8 @@ def exponential_backoff(retry_count, initial_timeout):
if retry_count == 1:
backoff_time = initial_timeout
else:
# Each subsequent retry increases the timeout by 50%
backoff_time = initial_timeout * (1.5 ** (retry_count - 1))
# Each subsequent retry increases the timeout by 70%
backoff_time = initial_timeout * (1.7 ** (retry_count - 1))

# Add a small random jitter to avoid synchronization
backoff_time += random.uniform(0, 1)
Expand Down

0 comments on commit cf81e4f

Please sign in to comment.