Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
MateoLostanlen committed Apr 10, 2024
1 parent 7087dc1 commit 915ef81
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/utils/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@


def get_token(api_url: str, login: str, pwd: str) -> str:
response = requests.post(
f"{api_url}/login/access-token",
data={"username": login, "password": pwd},
)
response = requests.post(f"{api_url}/login/access-token", data={"username": login, "password": pwd}, timeout=3)
if response.status_code != 200:
raise ValueError(response.json()["detail"])
return response.json()["access_token"]
Expand Down

0 comments on commit 915ef81

Please sign in to comment.