1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +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."""
from ast import parse
from typing import Dict, List, NamedTuple, Optional, Union, cast
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")
try:
data = requests.get(target).json()
data = requests.get(target, timeout=10).json()
except ValueError as e:
logger.warning(f"Failed to get kill switches, data was invalid: {e}")