fix retry and failure

correcting multiple issues with some bad code

https://github.com/SpudGunMan/meshing-around/issues/137

https://github.com/SpudGunMan/meshing-around/issues/156
This commit is contained in:
SpudGunMan
2025-07-20 05:41:50 -07:00
parent cc58a38165
commit 1895a365ae
2 changed files with 8 additions and 4 deletions
+7 -2
View File
@@ -823,8 +823,13 @@ def onDisconnect(interface):
logger.critical(f"System: Lost Connection to Device {interface}")
for i in range(1, 10):
if globals().get(f'interface{i}_enabled'):
globals()[f'retry_int{i}'] = True
break
if globals().get(f'max_retry_count{i}') > 0:
retry_flag = globals().get(f'retry_int{i}')
if not retry_flag:
globals()[f'retry_int{i}'] = True
else:
logger.critical(f"System: Interface{i} {globals()[f'interface{i}']} failed to reconnect after multiple attempts. Exiting")
exit_handler()
def exit_handler():
# Close the interface and save the BBS messages