From 48224f076970ac7d08450332b05724c3a9edb402 Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Mon, 2 Dec 2024 14:09:51 +0300 Subject: [PATCH] Removes unused max_delay variable & other related variables --- packages/http/httpx/kiota_http/middleware/retry_handler.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/http/httpx/kiota_http/middleware/retry_handler.py b/packages/http/httpx/kiota_http/middleware/retry_handler.py index 7aecb34..24dc748 100644 --- a/packages/http/httpx/kiota_http/middleware/retry_handler.py +++ b/packages/http/httpx/kiota_http/middleware/retry_handler.py @@ -78,12 +78,10 @@ async def send(self, request: httpx.Request, transport: httpx.AsyncBaseTransport _span.set_attribute("com.microsoft.kiota.handler.retry.enable", True) _span.end() retry_valid = current_options.should_retry - max_delay = current_options.max_delay _retry_span = self._create_observability_span( request, f"RetryHandler_send - attempt {retry_count}" ) while retry_valid: - start_time = time.time() response = await super().send(request, transport) _retry_span.set_attribute(HTTP_RESPONSE_STATUS_CODE, response.status_code) # check that max retries has not been hit @@ -97,8 +95,6 @@ async def send(self, request: httpx.Request, transport: httpx.AsyncBaseTransport should_retry = self.should_retry(request, current_options, response) if all([should_retry, retry_valid, delay < RetryHandlerOption.MAX_DELAY]): time.sleep(delay) - end_time = time.time() - max_delay -= (end_time - start_time) # increment the count for retries retry_count += 1 request.headers.update({'retry-attempt': f'{retry_count}'})