🛠️ Implemented timeout for `requests calls.
This commit is contained in:
+4
-1
@@ -61,6 +61,8 @@ __ERROR_KEY__ = (
|
||||
},
|
||||
)
|
||||
|
||||
from constants import REQUESTS_TIMEOUT_SEC
|
||||
|
||||
|
||||
def getNum():
|
||||
return len(__API_KEYS__["keys"])
|
||||
@@ -94,7 +96,8 @@ def getVersion():
|
||||
|
||||
# Load from gist
|
||||
try:
|
||||
respond = requests.get("https://api.github.com/gists/48d01f5a24b4b7b37f19443977c22cd6")
|
||||
respond = requests.get("https://api.github.com/gists/48d01f5a24b4b7b37f19443977c22cd6",
|
||||
timeout=REQUESTS_TIMEOUT_SEC)
|
||||
if respond.status_code == 200:
|
||||
content = respond.json()["files"]["tidal-api-key.json"]["content"]
|
||||
__API_KEYS__ = json.loads(content)
|
||||
|
||||
Reference in New Issue
Block a user