Skip to content

Commit

Permalink
Increase single image download timeout and add error notification
Browse files Browse the repository at this point in the history
  • Loading branch information
quantrancse committed Mar 28, 2020
1 parent 33011fd commit a5773da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/python/download_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def downloadImage(self, image_data_list):

# Limit download time of an image is 5 secs
start = time.time()
timeout = 5
timeout = 10
while True:
try:
img_data = requests.get(
Expand All @@ -161,6 +161,7 @@ def downloadImage(self, image_data_list):
break
except:
if time.time() - start > timeout:
MessageBox("Error download image: " + img_path_name)
break
print('Retry: download image: ' + img_url)
time.sleep(1)
Expand Down

0 comments on commit a5773da

Please sign in to comment.