From ef7135cd98859f72bd42d3565304aa8bc745bf69 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Oct 2019 19:28:04 +0100 Subject: [PATCH] Replace exponential backoff with regular retries --- posts.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/posts.py b/posts.py index a0cecf57..a7618ba9 100644 --- a/posts.py +++ b/posts.py @@ -1006,10 +1006,10 @@ def createReportPost(baseDir: str, def threadSendPost(session,postJsonStr: str,federationList: [],\ inboxUrl: str, baseDir: str,signatureHeaderJson: {},postLog: [], debug :bool) -> None: - """Sends a post with exponential backoff + """Sends a with retries """ tries=0 - backoffTime=60 + sendIntervalSec=30 for attempt in range(20): postResult=None try: @@ -1043,9 +1043,8 @@ def threadSendPost(session,postJsonStr: str,federationList: [],\ if debug: print(postJsonStr) print('DEBUG: json post to '+inboxUrl+' failed. Waiting for '+ \ - str(backoffTime)+' seconds.') - time.sleep(backoffTime) - backoffTime *= 2 + str(sendIntervalSec)+' seconds.') + time.sleep(sendIntervalSec) tries+=1 def sendPost(projectVersion: str, \