monolith/utils/cleanup.py

18 lines
323 B
Python
Raw Normal View History

import main
from twisted.internet import reactor
from utils.logging.debug import debug
2022-07-21 12:39:41 +00:00
from utils.logging.log import *
import sys
2022-07-21 12:39:41 +00:00
def handler(sig, frame):
log("Received SIGINT, cleaning up")
cleanup()
2022-07-21 12:39:41 +00:00
def cleanup():
debug("Flushing Redis database")
main.r.flushdb()
reactor.stop()
2022-07-21 12:39:41 +00:00
# sys.exit(1)