Added timeout to GET for killswitches

This commit is contained in:
A_D authored and Athanasius committed 2021-04-01 14:45:47 +01:00
1 parent 29adaa413b
commit 517a0e1f7c
1 file changed
+1 -2
+1 -2
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}")