Send first alert "immediately" if critical temp status

i.e. only wait for "first email" delay if *not* critical

courtesy of Cole Chaney <cole@mamajeansmarket.com>
This commit is contained in:
Lance Edgar 2018-02-07 17:45:06 -06:00
parent f8f29a8551
commit 8a1551e0f5

View file

@ -143,9 +143,11 @@ class TempmonServerDaemon(Daemon):
return
# delay even the first email, until configured threshold is reached
timeout = datetime.timedelta(minutes=probe.therm_status_timeout)
if (self.now - probe.status_changed) <= timeout:
return
# unless we have a critical status
if status != self.enum.TEMPMON_PROBE_STATUS_CRITICAL_TEMP:
timeout = datetime.timedelta(minutes=probe.therm_status_timeout)
if (self.now - probe.status_changed) <= timeout:
return
msgtypes = {
self.enum.TEMPMON_PROBE_STATUS_LOW_TEMP : 'tempmon_low_temp',