From d0e1c53fde1a368788468f808a9c6af96e5f963f Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Sat, 12 Oct 2024 17:00:47 -0400 Subject: [PATCH] Retry marshaller activation on timeout --- ground-control.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ground-control.py b/ground-control.py index ecade2b..255c155 100644 --- a/ground-control.py +++ b/ground-control.py @@ -78,8 +78,14 @@ def is_east_door_currently_open(): def activate_marshaller(): print('activating marshaller', flush=True) - requests.get(marshaller_uri, timeout=1) - requests.get(marshaller_uri, timeout=1) + + for _ in range(2): + try: + requests.get(marshaller_uri, timeout=1) + except requests.exceptions.ReadTimeout: + print('read timeout - retrying marshaller', flush=True) + sleep(2) + requests.get(marshaller_uri, timeout=1)