Retry marshaller activation on timeout

This commit is contained in:
Mike Cifelli 2024-10-12 17:00:47 -04:00
parent 8dede76f87
commit d0e1c53fde
Signed by: mike
GPG Key ID: 6B08C6BE47D08E4C
1 changed files with 8 additions and 2 deletions

View File

@ -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)