Use SIGINT signal for podman stop.

This commit is contained in:
yohan 2024-06-06 23:49:07 +02:00
parent e7b3115a16
commit 1ac6521182
2 changed files with 2 additions and 3 deletions

View File

@ -9,4 +9,5 @@ WORKDIR /root
COPY thermostat.py /root/ COPY thermostat.py /root/
COPY entrypoint.sh /root/ COPY entrypoint.sh /root/
ENV FLASK_APP thermostat.py ENV FLASK_APP thermostat.py
STOPSIGNAL SIGINT
ENTRYPOINT ["/root/entrypoint.sh"] ENTRYPOINT ["/root/entrypoint.sh"]

View File

@ -381,10 +381,8 @@ def thermostat_loop():
else: else:
logging.debug("Relay already off.") logging.debug("Relay already off.")
time.sleep(load_shedder_interval) time.sleep(load_shedder_interval)
logging.info("====== Ended successfully ======")
t1 = Thread(target=thermostat_loop) t1 = Thread(target=thermostat_loop)
t1.daemon = True t1.daemon = True
t1.start() t1.start()
dbconn.close()
logging.info("====== Ended successfully ======")