1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Removed shutdown handling

This commit is contained in:
krateng 2022-01-03 20:45:55 +01:00
parent 03dd902e1b
commit 8ab42b844b

View File

@ -1,6 +1,5 @@
# technical
import sys
import signal
import os
from threading import Thread
import setproctitle
@ -265,27 +264,6 @@ def redirect_track(artists,title):
redirect("/track?title=" + title + "&" + "&".join("artist=" + artist for artist in artists.split("/")))
######
### SHUTDOWN
#####
def graceful_exit(sig=None,frame=None):
#urllib.request.urlopen("http://[::1]:" + str(DATABASE_PORT) + "/sync")
log("Received signal to shutdown")
try:
database.sync()
except Exception as e:
log("Error while shutting down!",e)
log("Server shutting down...")
sys.exit(0)
#set graceful shutdown
signal.signal(signal.SIGINT, graceful_exit)
signal.signal(signal.SIGTERM, graceful_exit)
######