From c99d73dbc14f594d13c9022f92f384d3b0368e5e Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Fri, 7 Jun 2024 02:30:46 +0200 Subject: [PATCH] Test shutdown. --- thermostat.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/thermostat.py b/thermostat.py index da9eafe..7c384f4 100755 --- a/thermostat.py +++ b/thermostat.py @@ -383,14 +383,15 @@ def thermostat_loop(): time.sleep(load_shedder_interval) logging.info("====== Ended successfully ======") -#if __name__ == '__main__': xprint('toto1') t1 = Thread(target=thermostat_loop) -#t1.daemon = True t1.start() xprint('toto2') gunicorn_app = app xprint('toto3') -#t1.join() -#exit(0) -# app.run(host='0.0.0.0', port=3002) +while True: + if stop.is_set(): + dbconn.close() + break + time.sleep(0.5) +exit(0)