Implement Ctrl-C handling and fix a large number of small bugs

This commit is contained in:
2019-09-28 19:46:10 +01:00
parent 006f8db6f6
commit 15ca45e5df
12 changed files with 88 additions and 61 deletions

15
utils/cleanup.py Normal file
View File

@@ -0,0 +1,15 @@
import main
from twisted.internet import reactor
from utils.logging.debug import debug
from utils.logging.log import *
import sys
def handler(sig, frame):
log("Received SIGINT, cleaning up")
cleanup()
def cleanup():
debug("Flushing Redis database")
main.r.flushdb()
reactor.stop()
#sys.exit(1)