Commit 6b10848f authored by Grégory Wisniewski's avatar Grégory Wisniewski

Factorise connectionClosed and timeoutExpired logic.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1544 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e92d528c
...@@ -93,19 +93,18 @@ class ClientElectionHandler(ElectionHandler): ...@@ -93,19 +93,18 @@ class ClientElectionHandler(ElectionHandler):
conn.ask(Packets.AskPrimary()) conn.ask(Packets.AskPrimary())
MasterHandler.connectionCompleted(self, conn) MasterHandler.connectionCompleted(self, conn)
def connectionClosed(self, conn): def _connectionLost(self, conn):
addr = conn.getAddress() addr = conn.getAddress()
node = self.app.nm.getByAddress(addr) node = self.app.nm.getByAddress(addr)
node.setTemporarilyDown() node.setTemporarilyDown()
self.app.negotiating_master_node_set.discard(addr) self.app.negotiating_master_node_set.discard(addr)
MasterHandler.connectionClosed(self, conn) MasterHandler.connectionClosed(self, conn)
def connectionClosed(self, conn):
self._connectionLost(conn)
def timeoutExpired(self, conn): def timeoutExpired(self, conn):
addr = conn.getAddress() self._connectionLost(conn)
node = self.app.nm.getByAddress(addr)
node.setTemporarilyDown()
self.app.negotiating_master_node_set.discard(addr)
MasterHandler.timeoutExpired(self, conn)
def peerBroken(self, conn): def peerBroken(self, conn):
addr = conn.getAddress() addr = conn.getAddress()
......
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