stop listening port only if it is not None

This commit is contained in:
hackrush 2018-08-12 17:15:51 +05:30 committed by Jack Robison
parent 6a8963d807
commit 08b4fd6942
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -256,7 +256,8 @@ class AuthJSONRPCServer(AuthorizedBase):
# ignore INT/TERM signals once shutdown has started
signal.signal(signal.SIGINT, self._already_shutting_down)
signal.signal(signal.SIGTERM, self._already_shutting_down)
self.listening_port.stopListening()
if self.listening_port:
self.listening_port.stopListening()
self.looping_call_manager.shutdown()
if self.analytics_manager:
self.analytics_manager.shutdown()