This commit is contained in:
Matthew Frost 2023-11-01 00:20:04 +01:00
parent 9ed547c701
commit 5e9b04db6e

View file

@ -45,7 +45,7 @@ def send_http_request_with_retry(url, data, headers):
elif reader_info.get("mode") == "TOGGLE":
ser.write("toggle".encode('utf-8'))
break # Successful request, no need to retry
elif response.status_code in [400, 401, 500]:
elif response.status_code in [400, 401, 403, 500]:
# Don't retry on certain errors
print(f"HTTP POST request failed with status code {response.status_code}. Not retrying.")
break