2022-07-21 12:39:59 +00:00
|
|
|
import main
|
2022-07-21 12:40:01 +00:00
|
|
|
from twisted.internet import reactor
|
2019-09-28 18:46:10 +00:00
|
|
|
from utils.logging.debug import debug
|
2022-07-21 12:40:05 +00:00
|
|
|
from utils.logging.log import log
|
2019-09-28 18:46:10 +00:00
|
|
|
|
2022-07-21 12:39:41 +00:00
|
|
|
|
2019-09-28 18:46:10 +00:00
|
|
|
def handler(sig, frame):
|
|
|
|
log("Received SIGINT, cleaning up")
|
|
|
|
cleanup()
|
|
|
|
|
2022-07-21 12:39:41 +00:00
|
|
|
|
2019-09-28 18:46:10 +00:00
|
|
|
def cleanup():
|
|
|
|
debug("Flushing Redis database")
|
|
|
|
main.r.flushdb()
|
|
|
|
reactor.stop()
|
2022-07-21 12:39:41 +00:00
|
|
|
# sys.exit(1)
|