From f2943b867dfd586742b122c3b094ff9d9c1bbf3f Mon Sep 17 00:00:00 2001 From: Moritz Maas <utwlw@student.kit.edu> Date: Wed, 19 Mar 2025 15:03:33 +0100 Subject: [PATCH] chore: get webinterface from main --- uppaal2jetracer/httphandler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/uppaal2jetracer/httphandler.py b/uppaal2jetracer/httphandler.py index 21f8b01..3602b84 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 -- GitLab