pull/997/head
Louis Vézina 5 years ago
parent 5177214450
commit 60d5d909cf

@ -465,22 +465,25 @@ def test_notification(protocol, provider):
class Server: class Server:
# Mute DeprecationWarning try:
warnings.simplefilter("ignore", DeprecationWarning) if args.dev:
# Mute Insecure HTTPS requests made to Sonarr and Radarr server = app.run(host=str(settings.general.ip),
warnings.filterwarnings('ignore', message='Unverified HTTPS request') port=(int(args.port) if args.port else int(settings.general.port)))
# Mute Python3 BrokenPipeError else:
warnings.simplefilter("ignore", BrokenPipeError) server = create_server(app,
host=str(settings.general.ip),
if args.dev: port=int(args.port) if args.port else int(settings.general.port),
server = app.run( threads=24)
host=str(settings.general.ip), except:
port=(int(args.port) if args.port else int(settings.general.port))) pass
else:
server = create_server(app, def __init__(self):
host=str(settings.general.ip), # Mute DeprecationWarning
port=int(args.port) if args.port else int(settings.general.port), warnings.simplefilter("ignore", DeprecationWarning)
threads=24) # Mute Insecure HTTPS requests made to Sonarr and Radarr
warnings.filterwarnings('ignore', message='Unverified HTTPS request')
# Mute Python3 BrokenPipeError
warnings.simplefilter("ignore", BrokenPipeError)
@classmethod @classmethod
def start(cls): def start(cls):
@ -497,8 +500,8 @@ class Server:
def shutdown(cls): def shutdown(cls):
try: try:
cls.server.close() cls.server.close()
except: except Exception as e:
logging.error('BAZARR Cannot stop Waitress.') logging.error('BAZARR Cannot stop Waitress: ' + repr(e))
else: else:
database.close() database.close()
try: try:
@ -515,8 +518,8 @@ class Server:
def restart(cls): def restart(cls):
try: try:
cls.server.close() cls.server.close()
except: except Exception as e:
logging.error('BAZARR Cannot stop Waitress.') logging.error('BAZARR Cannot stop Waitress: ' + repr(e))
else: else:
database.close() database.close()
try: try:

Loading…
Cancel
Save