retries
All checks were successful
Deploy powerbar.ti Frontend Portal / Deploy-Tinance2-Frontend-Portal-Production (push) Successful in 36s

This commit is contained in:
Matthew Frost 2024-02-02 12:40:51 +01:00
parent d6194534f5
commit 125ab9871e

View file

@ -3,6 +3,8 @@ import re
from app.settings import powerbars, groups from app.settings import powerbars, groups
import time import time
retries = 5
def check_input_error(tn): def check_input_error(tn):
tn.write("/\r\n".encode('ascii')) tn.write("/\r\n".encode('ascii'))
for _ in range(3): for _ in range(3):
@ -19,7 +21,7 @@ def get_telnet_connection(powerbar):
def run_telnet_command(powerbar, command): def run_telnet_command(powerbar, command):
retries = 5
for _ in range(retries): for _ in range(retries):
try: try:
tn = get_telnet_connection(powerbar) tn = get_telnet_connection(powerbar)
@ -32,7 +34,6 @@ def run_telnet_command(powerbar, command):
pass pass
def get_baytech_status_outlet_telnet(powerbar): def get_baytech_status_outlet_telnet(powerbar):
retries = 5
for _ in range(retries): for _ in range(retries):
try: try:
# Create a Telnet object and connect to the host # Create a Telnet object and connect to the host