Fixed #206: Check applications exist before timing them out

This commit is contained in:
Andrew Godwin 2018-05-25 12:33:46 +02:00 committed by Andrew Godwin
parent c4360fd70a
commit fa3c764433

View File

@ -210,7 +210,7 @@ class Server(object):
# First, see if the protocol disconnected and the app has taken # First, see if the protocol disconnected and the app has taken
# too long to close up # too long to close up
if disconnected and time.time() - disconnected > self.application_close_timeout: if disconnected and time.time() - disconnected > self.application_close_timeout:
if not application_instance.done(): if application_instance and not application_instance.done():
logger.warning( logger.warning(
"Application instance %r for connection %s took too long to shut down and was killed.", "Application instance %r for connection %s took too long to shut down and was killed.",
application_instance, application_instance,