Test shutdown.
This commit is contained in:
parent
fa1f7cfd97
commit
7e674b165a
@ -162,9 +162,14 @@ stop = Event()
|
||||
|
||||
def handler(signum, frame):
|
||||
global stop
|
||||
global t1
|
||||
global dbconn
|
||||
logging.info("Got interrupt: "+str(signum))
|
||||
stop.set()
|
||||
logging.info("Shutdown")
|
||||
t1.join()
|
||||
dbconn.close()
|
||||
exit(0)
|
||||
|
||||
signal.signal(signal.SIGTERM,handler)
|
||||
signal.signal(signal.SIGINT,handler)
|
||||
@ -383,9 +388,6 @@ def thermostat_loop():
|
||||
time.sleep(load_shedder_interval)
|
||||
logging.info("====== Ended successfully ======")
|
||||
|
||||
xprint('toto1')
|
||||
t1 = Thread(target=thermostat_loop)
|
||||
t1.start()
|
||||
xprint('toto2')
|
||||
gunicorn_app = app
|
||||
xprint('toto3')
|
||||
|
Loading…
Reference in New Issue
Block a user