Skip to content

Commit

Permalink
Merge pull request #6 from blasferna/5-add-timeout-to-http-requests
Browse files Browse the repository at this point in the history
Added timeout to requests
  • Loading branch information
blasferna authored Jun 4, 2022
2 parents d1c160c + 0a99135 commit e52c880
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_citizen(document):
data = {"cedula": None, "apellidos": None, "nombres": None, "fecNac": None}
session = requests.Session()
response = session.request(
"GET", CITIZEN_URL, params={"t3": encrypt_param(document, "cedula")}
"GET", CITIZEN_URL, params={"t3": encrypt_param(document, "cedula")}, timeout=(5, 5)
)
if len(response.text) == 0:
raise DoesNotExist("Not found")
Expand Down Expand Up @@ -45,7 +45,7 @@ def get_taxpayer(document):
}
session = requests.Session()
response = session.request(
"GET", TAXPAYER_URL, params={"t3": encrypt_param(document, "ruc")}
"GET", TAXPAYER_URL, params={"t3": encrypt_param(document, "ruc")}, timeout=(5, 5)
)
if len(response.text) == 0:
citizen = get_citizen(document)
Expand Down

0 comments on commit e52c880

Please sign in to comment.