Commit 623bfb1c authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

setup default TIMEOUT for some request

parent aaa52802
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ class Notifications():

    def request_post(self, url, data):
        headers = {'content-type': 'application/json'}
        return requests.post(url, json={'text': str(data.to_str())}, headers=headers, timeout=os.getenv("TIMEOUT"))
        return requests.post(url, json={'text': str(data.to_str())}, headers=headers, timeout=os.getenv("TIMEOUT", "30"))
    
    async def send_request(self, url, data):
        async with aiohttp.ClientSession() as session:
+1 −1
Original line number Diff line number Diff line
@@ -11,4 +11,4 @@ class Notifications():

    def request_post(self, url, data):
        headers = {'content-type': 'application/json'}
        return requests.post(url, json={'text': str(data.to_str())}, headers=headers, timeout=int(os.getenv("TIMEOUT")))
 No newline at end of file
        return requests.post(url, json={'text': str(data.to_str())}, headers=headers, timeout=int(os.getenv("TIMEOUT", "30")))
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ class RegisterOperations:
            current_app.logger.debug(f"Request Helper service to remove user related information")
            url = f"https://{self.config["ccf"]["url"]}{self.config["ccf"]["helper_remove_user"]}{uuid}"
            current_app.logger.debug(f"Url {url}")
            requests.delete(url, cert=("certs/superadmin.crt", "certs/superadmin.key"), verify="certs/ca_root.crt", timeout=int(os.getenv("TIMEOUT")))
            requests.delete(url, cert=("certs/superadmin.crt", "certs/superadmin.key"), verify="certs/ca_root.crt", timeout=int(os.getenv("TIMEOUT", "30")))
            
            current_app.logger.debug(f"Removing User with uuid {uuid} from db")
            mycol.delete_one({"uuid": uuid})