Commit 10e6c2e1 authored by Vincent Pelletier's avatar Vincent Pelletier

Move invariant out of loop.

parent 98bc6f10
...@@ -345,10 +345,10 @@ class Application(object): ...@@ -345,10 +345,10 @@ class Application(object):
# Wait for an announcement. If this is too long, probably # Wait for an announcement. If this is too long, probably
# the primary master is down. # the primary master is down.
t = time() t = time() + 10
while self.primary_master_node is None: while self.primary_master_node is None:
self.em.poll(1) self.em.poll(1)
if t + 10 < time(): if t < time():
# election timeout # election timeout
raise ElectionFailure("Election timeout") raise ElectionFailure("Election timeout")
......
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