From b5d9fa1dd83948f3a6a7087b2b069c8c2f3c61e0 Mon Sep 17 00:00:00 2001 From: Nahuel Lofeudo Date: Sat, 11 Nov 2023 15:46:51 +0000 Subject: [PATCH] Add timeouts to the calls to the GTFS-R API --- gtfs_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs_client.py b/gtfs_client.py index bb35d2c..803c001 100644 --- a/gtfs_client.py +++ b/gtfs_client.py @@ -257,7 +257,7 @@ class GTFSClient(): # Poll GTFS-R API if self.gtfs_r_api_key != "": headers = {"x-api-key": self.gtfs_r_api_key} - response = requests.get(url = self.gtfs_r_url, headers = headers) + response = requests.get(url = self.gtfs_r_url, headers = headers, timeout=(2, 10)) if response.status_code != 200: print("GTFS-R sent non-OK response: {}\n{}".format(response.status_code, response.text)) return ({}, [], [])