Merge pull request #810 from smaarn/fix/shutdown-upon-keyboard-interruption-should-not-fail

fix: if authorizations check are required keyboard interruptions woul…
This commit is contained in:
morpheus65535 2020-02-09 08:06:03 -05:00 committed by GitHub
commit 4ad3fbff74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,6 +205,9 @@ def redirect_root():
@custom_auth_basic(check_credentials) @custom_auth_basic(check_credentials)
def shutdown(): def shutdown():
authorize() authorize()
doShutdown()
def doShutdown():
try: try:
server.stop() server.stop()
except: except:
@ -2215,4 +2218,4 @@ try:
args.port) if args.port else str(settings.general.port)) + str(base_url)) args.port) if args.port else str(settings.general.port)) + str(base_url))
server.start() server.start()
except KeyboardInterrupt: except KeyboardInterrupt:
shutdown() doShutdown()