Skip to content
Browse files

Bug 1267531 - Wait longer between failed treeherder submissions; r=bc

  • Loading branch information...
1 parent c1d61d2 commit df3e2b781d24d6e230a52edbe1a568189ef3b6cf @gbrownmozilla gbrownmozilla committed May 3, 2016
Showing with 7 additions and 4 deletions.
  1. +7 −4 autophonetreeherder.py
View
11 autophonetreeherder.py
@@ -559,7 +559,7 @@ def submit_complete(self, machine, build_url, project, revision_hash,
def serve_forever(self):
while not self.shutdown_requested:
- wait = True
+ wait_seconds = 0
job = self.jobs.get_next_treeherder_job()
if job:
tjc = TreeherderJobCollection()
@@ -568,9 +568,12 @@ def serve_forever(self):
tjc.add(tj)
if self.post_request(job['machine'], job['project'], tjc, job['attempts'], job['last_attempt']):
self.jobs.treeherder_job_completed(job['id'])
- wait = False
- if wait:
- for i in range(self.retry_wait):
+ else:
+ attempts = int(job['attempts'])
+ wait_seconds = min(self.retry_wait * attempts, 3600)
+ if wait_seconds > 0:
+ logger.debug('AutophoneTreeherder waiting for %d seconds after failed attempt %d' % (wait_seconds, attempts))
+ for i in range(wait_seconds):
if self.shutdown_requested:
break
time.sleep(1)

0 comments on commit df3e2b7

Please sign in to comment.
Something went wrong with that request. Please try again.