From b6bc9dde30ed141dad98ee14cbffe460de75b4d3 Mon Sep 17 00:00:00 2001 From: cragwolfe Date: Sat, 24 Aug 2024 11:25:30 -0700 Subject: [PATCH] Update request_utils.py Should be equivalent to: ``` >>> a = [min(math.floor(3 * (1.88 ** i)), 720) for i in range(10)]; a; [sum(a[:i+1]) for i in range(len(a))] [3, 5, 10, 19, 37, 70, 132, 249, 468, 720] [3, 8, 18, 37, 74, 144, 276, 525, 993, 1713] ``` --- src/unstructured_client/_hooks/custom/request_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/unstructured_client/_hooks/custom/request_utils.py b/src/unstructured_client/_hooks/custom/request_utils.py index ad282080..b3c5bde1 100644 --- a/src/unstructured_client/_hooks/custom/request_utils.py +++ b/src/unstructured_client/_hooks/custom/request_utils.py @@ -81,10 +81,10 @@ async def send_request_async_with_retries(client: httpx.AsyncClient, request: ht retry_config = utils.RetryConfig( "backoff", utils.BackoffStrategy( - initial_interval=2000, - max_interval=60000, - exponent=1.5, - max_elapsed_time=1000 * 60 * 5 # 5 minutes + initial_interval=3000, # 3 seconds + max_interval=1000 * 60 * 12, # 12 minutes + exponent=1.88, + max_elapsed_time=1000 * 60 * 30 # 30 minutes ), retry_connection_errors=True )