From 5830c7bd1598a29d6c9a0ebf5ed40f5219cdfaef Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 17 Oct 2018 19:26:48 -0500 Subject: [PATCH] Fix logic bug when checking readings for client yikes! first probe whose readings were checked okay, was causing other probes to just be skipped --- rattail_tempmon/server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rattail_tempmon/server.py b/rattail_tempmon/server.py index 615bddc..507d02c 100644 --- a/rattail_tempmon/server.py +++ b/rattail_tempmon/server.py @@ -124,7 +124,8 @@ class TempmonServerDaemon(Daemon): cutoff = self.now - datetime.timedelta(seconds=delay + 60) online = False 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" # readings, then let's look closer to see if it's been long enough to