monolith/utils/cleanup.py
2022-07-21 13:40:09 +01:00

18 lines
315 B
Python

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