From 0a991351f178cac615ea9d5b964c1abca5e7ba3f Mon Sep 17 00:00:00 2001 From: blasferna Date: Sat, 4 Jun 2022 08:13:16 -0400 Subject: [PATCH] Added timeout to requests --- app/_set.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/_set.py b/app/_set.py index a537677..aaf9023 100644 --- a/app/_set.py +++ b/app/_set.py @@ -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") @@ -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)