X-Git-Url: https://git.jsancho.org/?p=pyrabbit.git;a=blobdiff_plain;f=pyrabbit.py;h=351e98d6d39994afe7ce3271ae8a952b901740f7;hp=dfb9ac8f797051d6ad373962a89390c1ab85f48b;hb=HEAD;hpb=df284bf59c3d2eb7d900d39cc11df1c34558437f diff --git a/pyrabbit.py b/pyrabbit.py index dfb9ac8..351e98d 100644 --- a/pyrabbit.py +++ b/pyrabbit.py @@ -57,8 +57,11 @@ class Connection(object): t_start = time.time() method = None i = 0 + delay = 0.0 while method is None and (time.time()-t_start < timeout or timeout <= 0): - time.sleep(0.1) + time.sleep(delay) + if delay < 1: + delay += 0.01 method, properties, body = self.channel.basic_get(queues[i]) if i == len(queues) - 1: i = 0