Commit a2d4476c authored by Grégory Wisniewski's avatar Grégory Wisniewski

Instanciate only once the handler.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1586 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 1c8cc1fb
......@@ -636,12 +636,13 @@ class Application(object):
nm, em = self.nm, self.em
# select the storage handler
client_handler = client.ClientServiceHandler(self)
if state == ClusterStates.RECOVERING:
storage_handler = recovery.RecoveryHandler
storage_handler = recovery.RecoveryHandler(self)
elif state == ClusterStates.VERIFYING:
storage_handler = verification.VerificationHandler
storage_handler = verification.VerificationHandler(self)
elif state == ClusterStates.RUNNING:
storage_handler = storage.StorageServiceHandler
storage_handler = storage.StorageServiceHandler(self)
else:
RuntimeError('Unexpected node type')
......@@ -659,10 +660,9 @@ class Application(object):
if node.isClient():
if state != ClusterStates.RUNNING:
conn.close()
handler = client.ClientServiceHandler
handler = client_handler
elif node.isStorage():
handler = storage_handler
handler = handler(self)
conn.setHandler(handler)
handler.connectionCompleted(conn)
self.cluster_state = state
......
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