Commit 102d46ac authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c65e14a6
...@@ -221,8 +221,7 @@ class ClusterPdb(object): ...@@ -221,8 +221,7 @@ class ClusterPdb(object):
def wait(self, test, timeout): def wait(self, test, timeout):
end_time = time() + timeout end_time = time() + timeout
#period = 0.1 period = 0.1
period = 0.05
while not test(): while not test():
cluster_dict.acquire() cluster_dict.acquire()
try: try:
...@@ -233,12 +232,11 @@ class ClusterPdb(object): ...@@ -233,12 +232,11 @@ class ClusterPdb(object):
next_sleep = max(last_pdb + timeout, end_time) - time() next_sleep = max(last_pdb + timeout, end_time) - time()
if next_sleep > period: if next_sleep > period:
next_sleep = period next_sleep = period
#period *= 1.5 period *= 1.5
elif next_sleep < 0: elif next_sleep < 0:
return False return False
finally: finally:
cluster_dict.release() cluster_dict.release()
#print 'next_sleep:', next_sleep
sleep(next_sleep) sleep(next_sleep)
return True return True
......
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