Fix logic bug when checking readings for client

yikes! first probe whose readings were checked okay, was causing other probes
to just be skipped
This commit is contained in:
Lance Edgar 2018-10-17 19:26:48 -05:00
parent 3aa4185de9
commit 5830c7bd15

View file

@ -124,7 +124,8 @@ class TempmonServerDaemon(Daemon):
cutoff = self.now - datetime.timedelta(seconds=delay + 60) cutoff = self.now - datetime.timedelta(seconds=delay + 60)
online = False online = False
for probe in client.enabled_probes(): for probe in client.enabled_probes():
online = online or bool(self.check_readings_for_probe(session, probe, cutoff)) if self.check_readings_for_probe(session, probe, cutoff) and not online:
online = True
# if client was previously marked online, but we have no "new" # if client was previously marked online, but we have no "new"
# readings, then let's look closer to see if it's been long enough to # readings, then let's look closer to see if it's been long enough to