From 1ac6521182c0f5cc7b338dcf9fecb92eb181ce58 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Thu, 6 Jun 2024 23:49:07 +0200 Subject: [PATCH] Use SIGINT signal for podman stop. --- Dockerfile | 1 + thermostat.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0eb5e81..ba53944 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,5 @@ WORKDIR /root COPY thermostat.py /root/ COPY entrypoint.sh /root/ ENV FLASK_APP thermostat.py +STOPSIGNAL SIGINT ENTRYPOINT ["/root/entrypoint.sh"] diff --git a/thermostat.py b/thermostat.py index 23f7141..4309111 100644 --- a/thermostat.py +++ b/thermostat.py @@ -381,10 +381,8 @@ def thermostat_loop(): else: logging.debug("Relay already off.") time.sleep(load_shedder_interval) + logging.info("====== Ended successfully ======") t1 = Thread(target=thermostat_loop) t1.daemon = True t1.start() - -dbconn.close() -logging.info("====== Ended successfully ======")