Fixed possible invalid comparison in link watchdog job

This commit is contained in:
Mark Qvist 2023-08-05 15:10:00 +02:00
parent ae28f04ce4
commit 08bfd923ea
1 changed files with 5 additions and 1 deletions

View File

@ -510,7 +510,11 @@ class Link:
def __watchdog_job(self):
while not self.status == Link.CLOSED:
while (self.watchdog_lock):
sleep(max(self.rtt, 0.025))
rtt_wait = 0.025
if hasattr(self, "rtt") and self.rtt:
rtt_wait = self.rtt
sleep(max(rtt_wait, 0.025))
if not self.status == Link.CLOSED:
# Link was initiated, but no response