Add try/catch for client's "read temp" logic
this can isolate an error for a certain probe, so that other probes can go ahead and take their readings during each client run. that way only the bad one is marked as "error" status by the server
This commit is contained in:
parent
b644818eef
commit
8220082359
|
@ -137,8 +137,14 @@ class TempmonClient(Daemon):
|
||||||
Take a single reading and add to Rattail database.
|
Take a single reading and add to Rattail database.
|
||||||
"""
|
"""
|
||||||
reading = tempmon.Reading()
|
reading = tempmon.Reading()
|
||||||
|
|
||||||
|
try:
|
||||||
reading.degrees_f = self.read_temp(probe)
|
reading.degrees_f = self.read_temp(probe)
|
||||||
|
|
||||||
|
except:
|
||||||
|
log.exception("Failed to read temperature (but will keep trying) for probe: %s", probe)
|
||||||
|
|
||||||
|
else:
|
||||||
# a reading of 185.0 °F indicates some sort of power issue. when this
|
# a reading of 185.0 °F indicates some sort of power issue. when this
|
||||||
# happens we log an error (which sends basic email) but do not record
|
# happens we log an error (which sends basic email) but do not record
|
||||||
# the temperature. that way the server doesn't see the 185.0 reading
|
# the temperature. that way the server doesn't see the 185.0 reading
|
||||||
|
|
Loading…
Reference in a new issue