Commit b1123667 authored by Vincent Pelletier's avatar Vincent Pelletier

Get rid of a "while True".

Condition is true from the first iteration, as we just filled
unconnected_master_node_set.
parent 96827f57
...@@ -176,7 +176,8 @@ class Application(object): ...@@ -176,7 +176,8 @@ class Application(object):
else: else:
expiration = 10 expiration = 10
t = 0 t = 0
while True: while (self.unconnected_master_node_set or
self.negotiating_master_node_set):
current_time = time() current_time = time()
if current_time >= t: if current_time >= t:
t = current_time + 1 t = current_time + 1
...@@ -194,10 +195,6 @@ class Application(object): ...@@ -194,10 +195,6 @@ class Application(object):
ClientConnection(self.em, client_handler, addr=addr, ClientConnection(self.em, client_handler, addr=addr,
connector=self.connector_handler()) connector=self.connector_handler())
self.em.poll(1) self.em.poll(1)
if not (self.unconnected_master_node_set or
self.negotiating_master_node_set):
break
except ElectionFailure, m: except ElectionFailure, m:
# something goes wrong, clean then restart # something goes wrong, clean then restart
neo.lib.logging.error('election failed: %s', (m, )) neo.lib.logging.error('election failed: %s', (m, ))
......
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