mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-05-05 04:52:16 +02:00
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:
@@ -21,8 +21,7 @@ ping_enabled = True # ping feature to respond to pings, ack's etc.
|
||||
sitrep_enabled = True # sitrep feature to respond to sitreps
|
||||
lastHamLibAlert = 0 # last alert from hamlib
|
||||
lastFileAlert = 0 # last alert from file monitor
|
||||
max_retry_count1 = 4 # max retry count for interface 1
|
||||
max_retry_count2 = 4 # max retry count for interface 2
|
||||
max_retry_count1 = max_retry_count2 = max_retry_count3 = max_retry_count4 = max_retry_count5 = max_retry_count6 = max_retry_count7 = max_retry_count8 = max_retry_count9 = 4 # default retry count for interfaces
|
||||
retry_int1 = False
|
||||
retry_int2 = False
|
||||
wiki_return_limit = 3 # limit the number of sentences returned off the first paragraph first hit
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user