Commit cfe1b5ca authored by Julien Muchembled's avatar Julien Muchembled

client: small optimization when iterating over storage connections

parent 11d83ad9
...@@ -93,9 +93,11 @@ class ConnectionPool(object): ...@@ -93,9 +93,11 @@ class ConnectionPool(object):
if uuid in self.connection_dict: if uuid in self.connection_dict:
return CELL_CONNECTED return CELL_CONNECTED
failure = self.node_failure_dict.get(uuid) failure = self.node_failure_dict.get(uuid)
if failure is None or failure < time.time(): if failure:
return CELL_GOOD if time.time() < failure:
return CELL_FAILED return CELL_FAILED
self.node_failure_dict.pop(uuid, None)
return CELL_GOOD
def getConnForCell(self, cell): def getConnForCell(self, cell):
return self.getConnForNode(cell.getNode()) return self.getConnForNode(cell.getNode())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment