diff --git a/uppaal2jetracer/httphandler.py b/uppaal2jetracer/httphandler.py index 21f8b01bb89b6b1fa53892018cf8b2429890d430..3602b849674fb1176bdd0af57756daaeb686d3fa 100644 --- a/uppaal2jetracer/httphandler.py +++ b/uppaal2jetracer/httphandler.py @@ -27,6 +27,8 @@ class HTTPHandler: _UPDATE_ENDPOINT = "/api/update" _CONTENT_TYPE = "application/json" + _MAX_TIMEOUT = 10 + __slots__ = ("_url",) def __init__(self): @@ -51,8 +53,9 @@ class HTTPHandler: try: request_body = json.dumps({"body": {"message": msg}}) - post(self._url, data = request_body, headers = {"Content-type": self._CONTENT_TYPE}) + post(self._url, data = request_body, + headers = {"Content-type": self._CONTENT_TYPE}, + timeout = self._MAX_TIMEOUT) except ConnectionError: pass - \ No newline at end of file