From a5773da6973a63cfa7a20c55e8908505241d8424 Mon Sep 17 00:00:00 2001 From: quantrancse Date: Sat, 28 Mar 2020 13:00:35 +0700 Subject: [PATCH] Increase single image download timeout and add error notification --- src/main/python/download_engine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/python/download_engine.py b/src/main/python/download_engine.py index 2cf78fd..5321950 100644 --- a/src/main/python/download_engine.py +++ b/src/main/python/download_engine.py @@ -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( @@ -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)