Fixed some ruff warnings: requests without timeout and naming not complying with PEP

This commit is contained in:
Vincent Emonet 2023-07-09 12:38:03 +02:00
parent bf18dcbcf9
commit 1c0fb597fb
7 changed files with 25 additions and 31 deletions

View file

@ -87,7 +87,7 @@ class RemoteDatabase:
req_limit = self.cache.get(api_key)
if req_limit is None:
try:
r = requests.post(self.url, data={'api_key': api_key})
r = requests.post(self.url, data={'api_key': api_key}, timeout=60)
res = r.json()
except Exception as e:
print("Cannot authenticate API key: " + str(e))