From ce48d55dcba0b672184fcbb14d6a60edb686a0b6 Mon Sep 17 00:00:00 2001 From: Benjamin K <53038537+treee111@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:11:13 +0200 Subject: [PATCH] [FIX] Set timeout for file downloads to 30 minutes per file (pylint finding) (#149) * set timeout for file downloads to 30 minutes (pylint finding) * Bump to version v2.1.0a6 * Revert "Bump to version v2.1.0a6" This reverts commit 56f97aa253966c42c953a3888eddbd1b23200fe4. --- wahoomc/file_directory_functions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wahoomc/file_directory_functions.py b/wahoomc/file_directory_functions.py index e95729dd..97dd7259 100644 --- a/wahoomc/file_directory_functions.py +++ b/wahoomc/file_directory_functions.py @@ -113,7 +113,9 @@ def download_url_to_file(url, map_file_path): """ download the content of a ULR to file """ - request_geofabrik = requests.get(url, allow_redirects=True, stream=True) + # set timeout to 30 minutes (per file) + request_geofabrik = requests.get( + url, allow_redirects=True, stream=True, timeout=1800) if request_geofabrik.status_code != 200: log.error('! failed download URL: %s', url) sys.exit()