diff --git a/src/connection.py b/src/connection.py index 992d408..16278d4 100644 --- a/src/connection.py +++ b/src/connection.py @@ -105,7 +105,7 @@ class Connection(threading.Thread): self.status = 'disconnecting' if time.time() - self.last_message_sent > 300 and self.status == 'fully_established': self.send_queue.put(message.Message(b'pong', b'')) - if self.status == 'disconnecting': + if self.status == 'disconnecting' or shared.shutting_down: data = None if not data: self.status = 'disconnected' diff --git a/src/manager.py b/src/manager.py index fd4c24a..3511257 100644 --- a/src/manager.py +++ b/src/manager.py @@ -38,8 +38,6 @@ class Manager(threading.Thread): self.last_pickled_nodes = now if shared.shutting_down: - logging.debug('Shutting down connections') - self.shutdown_connections() logging.debug('Shutting down Manager') break @@ -86,11 +84,6 @@ class Manager(threading.Thread): shared.connections.add(c) shared.hosts = hosts - @staticmethod - def shutdown_connections(): - for c in shared.connections.copy(): - c.send_queue.put(None) - @staticmethod def pickle_objects(): try: