Make flask thread a daemon

This means the flask thread will also exit when the main thread receives
a KeyboardInterrupt. This closes #12.
This commit is contained in:
Jonatan Pålsson 2017-06-10 11:24:21 +02:00
parent 924fad4320
commit 2125b2d739

View file

@ -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__":