From 2125b2d73951976c3e38af4da32a7deef84ee3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20P=C3=A5lsson?= Date: Sat, 10 Jun 2017 11:24:21 +0200 Subject: [PATCH] Make flask thread a daemon This means the flask thread will also exit when the main thread receives a KeyboardInterrupt. This closes #12. --- logbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logbot.py b/logbot.py index 781e389..2b84199 100755 --- a/logbot.py +++ b/logbot.py @@ -350,6 +350,7 @@ def main(): create_tables() t = threading.Thread(target=flaskapp.run, kwargs={"host": "0.0.0.0"}) + t.daemon = True t.start() # Create the logs directory @@ -368,7 +369,6 @@ def main(): except KeyboardInterrupt: if FTP_SERVER: bot.ftp.quit() bot.quit() - t.join() if __name__ == "__main__":