This commit is contained in:
PaulVua
2025-01-23 14:28:44 +01:00
parent aa3b4d238b
commit 0fb7118abb

View File

@@ -227,6 +227,13 @@ def read_complete_response(serial_connection, timeout=2, end_of_response_timeout
# Final response and debug output # Final response and debug output
total_elapsed_time = time.time() - start_time total_elapsed_time = time.time() - start_time
print(f"[DEBUG] ⏱️ elapsed time: {total_elapsed_time:.2f}s. ⏱️") print(f"[DEBUG] ⏱️ elapsed time: {total_elapsed_time:.2f}s. ⏱️")
# Check if the elapsed time exceeded 10 seconds
if total_elapsed_time > 10:
print(f"[ALERT] 🚨 The operation took too long: {total_elapsed_time:.2f}s. 🚨")
print('<span style="color: red;font-weight: bold;"></span>')
print(f"{total_elapsed_time:.2f}s")
print('</span>')
return response.decode('utf-8', errors='replace') return response.decode('utf-8', errors='replace')
# Open and read the JSON file # Open and read the JSON file