diff --git a/modules/globalalert.py b/modules/globalalert.py index 28b08a1..4c6a592 100644 --- a/modules/globalalert.py +++ b/modules/globalalert.py @@ -16,7 +16,7 @@ def get_govUK_alerts(lat, lon): try: # get UK.gov alerts url = 'https://www.gov.uk/alerts' - response = requests.get(url) + response = requests.get(url, timeout=urlTimeoutSeconds) soup = bs.BeautifulSoup(response.text, 'html.parser') # the alerts are in

alert = soup.find('h2', class_='govuk-heading-m', id='alert-status') @@ -35,7 +35,7 @@ def get_nina_alerts(): alerts = [] for regionalKey in myRegionalKeysDE: url = ("https://nina.api.proxy.bund.dev/api31/dashboard/" + regionalKey + ".json") - response = requests.get(url) + response = requests.get(url, timeout=urlTimeoutSeconds) data = response.json() for item in data: @@ -53,7 +53,7 @@ def get_wxUKgov(): try: # get UK weather warnings url = 'https://www.metoffice.gov.uk/weather/guides/rss' - response = requests.get(url) + response = requests.get(url, timeout=urlTimeoutSeconds) soup = bs.BeautifulSoup(response.content, 'xml') items = soup.find_all('item') diff --git a/modules/locationdata.py b/modules/locationdata.py index 1542213..c9fb4ee 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -135,7 +135,7 @@ def getArtSciRepeaters(lat=0, lon=0): if zipCode.isnumeric(): try: artsci_url = f"http://www.artscipub.com/mobile/showstate.asp?zip={zipCode}" - response = requests.get(artsci_url) + response = requests.get(artsci_url, timeout=urlTimeoutSeconds) if response.status_code!=200: logger.error(f"Location:Error fetching data from {artsci_url} with status code {response.status_code}") soup = bs.BeautifulSoup(response.text, 'html.parser') diff --git a/modules/settings.py b/modules/settings.py index 28729ec..f786284 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -441,6 +441,6 @@ try: noisyTelemetryLimit = config['messagingSettings'].getint('noisyTelemetryLimit', 5) # default 5 packets except Exception as e: print(f"System: Error reading config file: {e}") - print(f"System: Check the config.ini against config.template file for missing sections or values.") - print(f"System: Exiting...") + print("System: Check the config.ini against config.template file for missing sections or values.") + print("System: Exiting...") exit(1)