monolith/legacy/utils/cleanup.py

18 lines
315 B
Python
Raw Normal View History

from twisted.internet import reactor
2022-07-21 12:40:09 +00:00
import main
from utils.logging.debug import debug
2022-07-21 12:40:05 +00:00
from utils.logging.log import log
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)