1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

Added timeout to GET for killswitches

This commit is contained in:
A_D 2020-10-16 08:06:39 +02:00 committed by Athanasius
parent 29adaa413b
commit 517a0e1f7c

View File

@ -1,5 +1,4 @@
"""Fetch kill switches from EDMC Repo.""" """Fetch kill switches from EDMC Repo."""
from ast import parse
from typing import Dict, List, NamedTuple, Optional, Union, cast from typing import Dict, List, NamedTuple, Optional, Union, cast
import requests import requests
@ -73,7 +72,7 @@ def fetch_kill_switches(target=DEFAULT_KILLSWITCH_URL) -> Optional[KILL_SWITCH_J
""" """
logger.info("Attempting to fetch kill switches") logger.info("Attempting to fetch kill switches")
try: try:
data = requests.get(target).json() data = requests.get(target, timeout=10).json()
except ValueError as e: except ValueError as e:
logger.warning(f"Failed to get kill switches, data was invalid: {e}") logger.warning(f"Failed to get kill switches, data was invalid: {e}")