From 34cdbeb3caae6e2e9f1ca6e0f9ddcbfce9fa6f99 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 10 Mar 2014 09:48:12 -0700 Subject: [PATCH] Use correct time.sleep argument. Use the correct time.sleep argument when sleeping. Also replace a post for loop if check with an else to make the code more readable. Change-Id: Icdfb41d1436abe930e4f45243ff6fe378ba3f91b --- elastic_recheck/elasticRecheck.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/elastic_recheck/elasticRecheck.py b/elastic_recheck/elasticRecheck.py index 1dcba93e..160ec291 100644 --- a/elastic_recheck/elasticRecheck.py +++ b/elastic_recheck/elasticRecheck.py @@ -260,10 +260,9 @@ class Stream(object): # function that does this. self.log.exception( "Elastic Search not responding on attempt %d" % i) - time.sleep(NUMBER_OF_RETRIES) + time.sleep(SLEEP_TIME) continue - - if i == NUMBER_OF_RETRIES - 1: + else: elapsed = format_timedelta(datetime.datetime.now() - started_at) msg = ("Console logs not available after %ss for %s %d,%d,%s" % (elapsed, job.name, event.change, event.rev,