mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-04 12:24:52 +00:00
Fixed some ruff warnings: requests without timeout and naming not complying with PEP
This commit is contained in:
parent
bf18dcbcf9
commit
1c0fb597fb
7 changed files with 25 additions and 31 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue