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:
		
							parent
							
								
									f8f29a8551
								
							
						
					
					
						commit
						8a1551e0f5
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -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',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue