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:
parent
924fad4320
commit
2125b2d739
1 changed files with 1 additions and 1 deletions
|
@ -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__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue