Implemented clean shutdown
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f6e0b7b25e
commit
a06e94147a
11
src/app.py
11
src/app.py
@ -89,7 +89,16 @@ def main() -> None:
|
||||
client.username_pw_set(config.MQTT_USERNAME, config.MQTT_PASSWORD)
|
||||
|
||||
client.connect(config.MQTT_HOSTNAME, config.MQTT_PORT, 60)
|
||||
client.loop_forever()
|
||||
|
||||
try:
|
||||
client.loop_forever() # This blocks
|
||||
except KeyboardInterrupt:
|
||||
logging.info("SIGINT recieved! Stopping...")
|
||||
pass
|
||||
|
||||
client.disconnect()
|
||||
loopingtimer.stop()
|
||||
BirbnetesIoTPlatformStatusDriver.cleanup()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user