Commit 08cf840e authored by Javier Velázquez's avatar Javier Velázquez
Browse files

Add timeout to post requests

parent 03cc0e30
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ def send_request(source, destination, ip):
    logging.debug(f"Payload for path computation: {json.dumps(payload, indent=2)}")

    try:
        response = requests.post(url, headers=headers, data=json.dumps(payload))
        response = requests.post(url, headers=headers, data=json.dumps(payload), timeout=15)
        return json.loads(response.text)
    except requests.exceptions.RequestException:
        logging.warning("Error connecting to the Optical Planner service. Skipping optical planning.")