Skip to content

Commit d0cc7e7

Browse files
committed
Wait time increase
1 parent db85fac commit d0cc7e7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

e2e/utils/immunisation_api.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def make_request_with_backoff(
5555
expected_status_code: int = 200,
5656
expected_connection_failure: bool = False,
5757
max_retries: int = 5,
58-
delay_seconds: float = 2.0,
5958
is_status_check: bool = False,
6059
**kwargs
6160
):
@@ -95,15 +94,13 @@ def make_request_with_backoff(
9594
raise
9695

9796
# This is will be used in the retry logic of the exponential backoff
98-
wait = (2 ** attempt) + random.uniform(0, 0.5)
99-
total_wait_time = wait + delay_seconds
100-
97+
delay = (3 ** attempt) + random.uniform(0, 0.5)
10198
print(
10299
f"[{datetime.now():%Y-%m-%d %H:%M:%S}] "
103-
f"[Retry {attempt + 1}] {http_method.upper()} {url}{e} — retrying in {total_wait_time:.2f}s"
100+
f"[Retry {attempt + 1}] {http_method.upper()} {url}{e} — retrying in {delay:.2f}s"
104101
)
105102

106-
time.sleep(total_wait_time)
103+
time.sleep(delay)
107104

108105
def create_immunization_resource(self, resource: dict = None) -> str:
109106
"""creates an Immunization resource and returns the resource url"""

0 commit comments

Comments
 (0)