safe_while: Don't sleep() on the first attempt

This was causing unnecessary delays in several places

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
This commit is contained in:
Zack Cerza 2014-04-17 11:08:36 -05:00
parent e323392778
commit fc94879498

View File

@ -119,6 +119,8 @@ class safe_while(object):
def __call__(self):
self.counter += 1
if self.counter == 1:
return True
if self.counter > self.tries:
error_msg = self._make_error_msg()
if self._raise: