monolith/legacy/utils/cleanup.py

17 lines
314 B
Python
Raw Normal View History

2022-07-21 12:40:09 +00:00
import main
2022-09-05 06:20:30 +00:00
from twisted.internet import reactor
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)