Fix import bug in server daemon
This commit is contained in:
		
							parent
							
								
									9a2fda3b68
								
							
						
					
					
						commit
						fc7ec58303
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -31,7 +31,7 @@ import datetime
 | 
			
		|||
import logging
 | 
			
		||||
 | 
			
		||||
from rattail.db import Session, api
 | 
			
		||||
from rattail_tempmon import Session as TempmonSession
 | 
			
		||||
from rattail_tempmon.db import Session as TempmonSession, model as tempmon
 | 
			
		||||
from rattail.daemon import Daemon
 | 
			
		||||
from rattail.time import localtime, make_utc
 | 
			
		||||
from rattail.mail import send_email
 | 
			
		||||
| 
						 | 
				
			
			@ -53,7 +53,9 @@ class TempmonServerDaemon(Daemon):
 | 
			
		|||
        self.extra_emails = self.config.getlist('rattail.tempmon', 'extra_emails', default=[])
 | 
			
		||||
        while True:
 | 
			
		||||
            self.check_readings()
 | 
			
		||||
            time.sleep(5)
 | 
			
		||||
 | 
			
		||||
            # TODO: make this configurable
 | 
			
		||||
            time.sleep(60)
 | 
			
		||||
 | 
			
		||||
    def check_readings(self):
 | 
			
		||||
        self.now = make_utc()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue